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 (January 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Jan 2000 15:39:05 -0500
Reply-To:     "Droogendyk, Harry" <Harry.Droogendyk@CITGROUP.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Droogendyk, Harry" <Harry.Droogendyk@CITGROUP.COM>
Subject:      FW: Mvs Sas-Variables used in a program
Content-Type: text/plain; charset="iso-8859-1"

Gary:

To ensure you grab variables that might be built using macros ( e.g. via %do loops, && resolution stuff ), it might be prudent to examine the program log ( ensuring MPRINT, SYMBOLGEN etc.. are turned on ) rather than the program.

Harry

-----Original Message----- From: charles_s_patridge@MY-DEJA.COM [mailto:charles_s_patridge@MY-DEJA.COM] Sent: Monday, January 10, 2000 3:12 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Mvs Sas-Variables used in a program

Dear Gary,

One possible solution (not 100%) would be to take the 1000 SAS variables from Proc Contents and put each one into a macro variable, and then using the SCAN Function, scan your program looking for that variable to see if it is used within the program. Make sure you "UPCASE or LOWCASE" the variable names as well as the PROGRAM to get compatiability.

For those variables not found, you would need to "double check" to make sure they are in fact not used.

I have a macro which does a scan and replace on a particular text string on all external sas programs which could be used to get an idea of how you could start such a program to do what you want. If you develop it, and it works, I would be happy to make it available for others to see and use by posting it on my web site.

Try looking at TIP00066 and TIP00077 on my website (www.sasconsig.com) for some ideas under "Tips and Techniques".

Regards, Charles Patridge Email: Charles_S_Patridge@prodigy.net

In article <387A1ED2.F9675E61@mgic.com>, Gary Ross <gary_ross@mgic.com> wrote: > This may take some explaining so bear with me. I have a "large" Sasfile > (lets say a 1000 variables) which is used in a complex, lengthy program. > For efficiency, I would like to reduce the 1000 variable Sasfile down to > only the variables used in the program. If there a easy Sas or other > software method of doing this? Just comparing Proc Contents does not > work because, for instance, the incoming Sasfile may have a date as 3 > variables (month, day and year) which in the program is converted to a > Sas date, dropping the 3 date variables from the output Sasfile. > > One tedious, cumbersome solution would be to feed the program a one > observation, one variable Sasfile and use the Saslog to identify > "uninitialized", "never been referenced", "not found", etc. variaables. > This could be repetitively done until a "clean" Saslog results. Not the > best solution though. > > Anyone have any thoughts? > >

-- Charles Patridge - PDPC, Ltd. 172 Monce Road - Burlington, CT 06013 860-673-9278 or 860-675-9026 Charles_S_Patridge@prodigy.net www.sasconsig.com

Sent via Deja.com http://www.deja.com/ Before you buy.


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