Date: Mon, 16 Jan 2012 13:49:00 -0500
Reply-To: Dave <d_crimkey@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave <d_crimkey@YAHOO.COM>
Subject: Re: compare items in array to large list
In-Reply-To: <CAEZCysv52SBB5HWLWZdyQTH46v_qf7BkXC8LJ+kt0mGE1Tn20g@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii
I like this approach but my Xcode file is just a one column list of invalid codes. How can create a format file from this list?
Sent from my iPhone
On Jan 15, 2012, at 2:08 PM, "Data _null_;" <iebupdte@gmail.com> wrote:
> How about creating an INFORMAT where the list of INVALID RECODES as
> invalid code list = _ERROR_ as the invalue and other=_SAME_. Then you
> will get an invalid data message and you can test _ERROR_ to see if
> the record is bad.
>
> On 1/15/12, dave crimkey <d_crimkey@yahoo.com> wrote:
>> I'm reading in a sas dataset that has the following fields: id,
>> revcode1-revcode45, xcode1-xcode45. FIrst I need to pull out invalid
>> revcodes from the 45 fields. The deal is that I have hardcoded a short list
>> of invalid revcode ranges and if the any of the 45 field values is not in
>> that list then the record is valid. If all revcodes in the record are in
>> the list then the record is invalid. There can be up-to 45 revcodes. I've
>> accomplished this part with an array, a loop and some flags. Now I need to
>> take the resulting dataset and compare xcode1-xcode45 to a list of about 100
>> invalid xcodes. The list is currently a text file. This is another deal
>> where if any xcode is valid then keep the record but if all xcodes are
>> invalid (on the list) then delete the record. How can I do this second
>> part? And, is there a way to accomplish both the revcode comparison and the
>> xcode comparison at once? There are about 8m recs in the file. I
>> thought about exploding it out so that I have 1 revcode per rec but I'd
>> still need to keep the 45 xcodes and at some point compare them. Any help
>> would be appreciated.
>>
>> Thanks,
>> Dave
>>
|