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
does it help to code it like that:
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
On Wed, 22 Aug 2007 11:47:35 -0400, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:
>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:
> 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)
>Any suggestions are appreciated. Thanks.
>Center for Health Program Development and Management
>University of Maryland, Baltimore County