LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 18 May 1998 14:32:52 -0500
Reply-To:     VWi@INGENIUM.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         "Victoria M. Wilkins" <VWi@INGENIUM.COM>
Subject:      Re: Rename 100s of variables - code compared
Content-type: text/plain; charset=US-ASCII

Just for the sake of wanting to see how efficient the code was on 100's of variables on a sizable dataset I created a dataset of 10,000 records containing 500 variables to rename. I checked this dataset against the code submitted by Adam Hendricks and Jack Hamilton. Both do the job and both are efficient.

For the sake of size I did not repost the code.

Victoria Wilkins

The results are: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>> Jack Hamilton's code....slightly modified to accomidate the 500 variables to rename and 10000 records:

I found this code to be not only effective but most efficient.

Clips from the log are:

NOTE: The data set WORK.SAMPLE has 10000 observations and 501 variables. NOTE: The DATA statement used 20.37 seconds.

Start Time - 13:53:10

NOTE: The PROCEDURE SQL used 0.17 seconds.

NOTE: Renaming variable XX0Y001 to XXY001. ....... NOTE: Renaming variable XX0Y500 to XXY500.

NOTE: The PROCEDURE DATASETS used 2.52 seconds.

Stop Time - 13:53:13

Elapsed Time - 0:00:03

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>

Adam Hendricks' code.....slightly modified to accomidate the 50 variables to rename and 10000 records

I found this code to be effective and only slightly less efficient.

NOTE: The data set WORK.SAMPLE has 10000 observations and 503 variables. NOTE: The DATA statement used 3.18 seconds.

Start Time - 14:18:27

NOTE: Table WORK.COLS created, with 500 rows and 1 columns.

NOTE: The PROCEDURE SQL used 0.48 seconds.

NOTE: The DATA statement used 0.7 seconds.

NOTE: Table WORK.SAMPLE created, with 10000 rows and 502 columns.

NOTE: The PROCEDURE SQL used 10.82 seconds.

Stop Time - 14:18:39

Elapsed Time - 0:00:13


Back to: Top of message | Previous page | Main SAS-L page