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 (August 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 22 Aug 2007 12:04:22 -0400
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: Is there a 'starts with' modifier available in KEEP= ds
              option?

does it help to code it like that:

data test; px1=11; dx1=1; dx2=2; dx3=3; dx4=4; keep dx1-dx4; run;

??

If you don't know the number 4, use dx1-dx9999; That gives a warning, that not all variables of the list are found - no problem. However, variables like dxaa, dxbb, ... are not kept with that.

If that helps not, the only thing I'm aware of is the SASHELP.VCOLUMN view where you can get all the variable names of your dataset. You can get them in a dataset and construct a KEEP-list with all SAS functions available. That you can fit in a macro variable via CALL SYMPUT and use it whereever needed.

Gerhard

On Wed, 22 Aug 2007 11:47:35 -0400, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:

>Hello, > >I have multiple data sets of medical claims data from different years. >I need to SET these data sets together and keep the diagnostic codes >from each observation. Every file has a primary diagnostic code (PDX), >but different files have different numbers of total diagnostic codes. >Some have DX2-DX4, others DX2-DX8 and still others DX2-DX12. > >I was wondering if there is a shorthand way in the KEEP= data set option >to keep all variables that start with 'DX'? > > >Here is a simplified version of what I have in mind: > >data need; > set inpt02 (keep=pdx (starts with)dx) > inpt03 (keep=pdx (starts with)dx) > opt02 (keep=pdx (starts with)dx) > opt03 (keep=pdx (starts with)dx) > ; >run; > >Any suggestions are appreciated. Thanks. > > >Jack Clark >Research Analyst >Center for Health Program Development and Management >University of Maryland, Baltimore County > >


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