Date: Wed, 20 Nov 1996 08:38:00 EST
Reply-To: "Kasperovic, Nicholas" <NKaspero@VITGCAB1.TELSTRA.COM.AU>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Kasperovic, Nicholas" <NKaspero@VITGCAB1.TELSTRA.COM.AU>
Subject: Re: Force read of 508 bytes?
Richard,
Try;-
INPUT;
DELETE;
The INPUT will read the record. The DELETE statement will ignore the
observation just read and go to the top (ie DATA statement ) to process the
next observation. I'm not sure how UNIX handles "\A\D" but I'm sure you
will master it.
Regards,
Nick KASPEROVIC
NKASPERO@VITGCAB1.TELECOM.COM.AU
Melbourne, AUSTRALIA
>----------
>From: Richard Wherry
>To: Multiple recipients of list SAS-L
>Subject: Force read of 508 bytes?
>Date: 19 November 1996 3:46
>
>
>Folks,
>
>I have a situation where I need to read in an external file of varying
>record lengths and record types. A certain record (recordtype=18)
>contains a warning that the record immediately following the curent
>record is to be read as a single record of 508 bytes. However, within
>these 508 bytes there may be a sequence denoting an end of record to SAS
>(the hexcode for \A\D).
>
>How do I read the 508 bytes without regard to any end of record
>delimiters that may appear? Basically, I want to FORCE SAS TO READ 508
>BYTES and throw it out (I do not need any of the information in this
>record).
>
>Here is some sample code:
>
>data xxx;
> infile blah recfm=v;
> input @2 rec_type pk1. @;
> if rec_type=14 then do; * No problem here!;
> input yy pk2. zz pk5.;
> end;
> if rec_type=18 then do; * This is the problem!;
> * skip to next line;
> * force a read of the next 508 bytes;
> end;
>run;
>
>
>Thanks for any help/advice you may offer!
>____
>rick
>
>P.S. I'm in an UNIX environment.
|