[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Search for a string within all SAS  data sets in a given directory
From:       toby dunn <tobydunn () HOTMAIL ! COM>
Date:       2013-08-29 16:52:04
Message-ID: COL125-W36F6BE95893F7CC0D80FBFDE340 () phx ! gbl
[Download RAW message or body]

If one wasnt opposed to RegEx's you could do:
 
Where PrcMatch( '/^MyTemp\..*?L.*?$/i' , Strip( CatX( '.' , LibName , MemName ) ) ) ;
 
Not sure if its any more or less efficienct but a variation.
 
 

 
> Date: Thu, 29 Aug 2013 15:58:26 +0000
> From: YBolotin@SCHOOLS.NYC.GOV
> Subject: Re: Search for a string within all SAS  data sets in a given              directory
> To: SAS-L@LISTSERV.UGA.EDU
> 
> It just looks at dataset names, right?
> 
> Here's something that looks for any dataset with the letter L in the name:
> 
> * set up input data ;
> data _z; run;
> data blah; run;
> data blah2; run;
> data hello; run;
> data nothing; run;
> 
> %let myfolder = %sysfunc(pathname(work)); *or whatever;
> %put &myfolder.;
> 
> *get names;
> Libname mytemp "&myfolder.";
> Data WANT;
>         Set sashelp.vstable;
>         Where
>                 libname = %upcase("MYTEMP")
>                 and memname like %upcase('%L%'); *note: single quotes around percent-signs;
> Run;
> 
> 
> 
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Dai, Randy
> Sent: Wednesday, August 28, 2013 11:57 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Search for a string within all SAS data sets in a given directory
> 
> Dear all,
> 
> Can anyone help to fix the sample code posted in following link ? What's wrong with this code?
> 
> http://support.sas.com/kb/50/806.html
> 
> 
> Best regards,
> 
> Randy
                                          =
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic