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 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 27 Jan 2004 11:06:04 -0500
Reply-To:     "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Subject:      Re: Can I have a wildcard in the middle?
Content-Type: text/plain; charset="iso-8859-1"

SQL offers the LIKE operator, used against sashelp views, it'll grab the dataset names you're looking for. Use &ds in the delete statement in DATASETS.

proc sql; select memname into :ds separated by ' ' from sashelp.vtable where libname = 'YOURLIB' and memname like 'TEST%_S' ; quit;

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Sarah Presley Sent: January 27, 2004 10:59 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Can I have a wildcard in the middle?

I'm sure that this is a no-brainer for everyone else on the list, but I need to know if SAS has a wildcard character which can be used in the middle of something.

I am running a proc data sets to delete some files:

proc data sets lib=pcdat memtype=data nolist; delete test:_s; run; quit;

What I want to delete are all data sets starting with 'test' and ending with '_s' (test1_s, test2_s ...). What I am actually deleting with this code are all data sets starting with 'test', regardless of what follows, and then I get a note telling me that the data set _s appears on the delete statement but doesn't exist in the library. So obviously, the procedure is treating test: as all data sets starting with 'test' and _s as a completely new data set.

So does SAS have a way of putting a wildcard in the middle of a data set or variable name?

Sarah

__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/


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