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 (November 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 4 Nov 2006 16:28:17 -0500
Reply-To:     SAS_learner <proccontents@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         SAS_learner <proccontents@GMAIL.COM>
Subject:      Re: OT: Chance to Make SAS-L History: Did You Know That...
Comments: To: "Choate, Paul@DDS" <pchoate@dds.ca.gov>
In-Reply-To:  <c2192a610611031613j73e8d1a1qb85d787099557a19@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

What going on did we reach the 150 or 300 posts (as david said ) or we are out tips, Just curious if there any tips uisng SQL or Little Utlity macros or some Domain knowledge, What I have in mind is people working various different fields Like people working in Pharma Industry use SAS for mostly do Tables and listings and DM work. They can share their valuable experience (tricks or tips ) unique to their field, I do not know how SAS is used in Financial sector ( do we have a similar kind of Knowledge ) or in energy sector or Eductional sector or Pharama Marketing ?? Or Usefull Url's for various subjects.

Here is another trick I use often at my work place Use PROC SQL dictionary tables to create a macro variable containing the variable names from a specified data set. Use PROC DATASETS to execute the rename.

data a;

col1=1; col2=2; col3=3; col5=5; x=123;

run;

proc sql noprint; select trim(name)||'=NEW'||substr(name,4) into :varlist separated by ' ' from DICTIONARY.COLUMNS WHERE LIBNAME EQ "WORK" and MEMNAME EQ "A" and upcase(name) like 'COL%'; quit; proc datasets library=work nolist; modify a; rename &varlist; quit;

On 11/3/06, SAS_learner <proccontents@gmail.com> wrote: > > Small Tip/Trick I learned from my manager who is also SAS-L Member. This > is close to call symput but runs on data rather than on metadata > > > Do something samething in all datasets in a lib you can do something like > this,Here I am droppping one variable from all the datasetsn > > %macro octa(ds= ); > data datout.&ds; > set datout.&ds ; > drop OCTA_SEQ; > run; > %mend; > > proc sql noprint; > select '%octa('||'ds= '||lowcase(memname)||')' into :blanks separated by > ';' > from dictionary.tables > where lowcase(libname) = 'datout'; > &blanks; > quit; >


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