Date: Mon, 27 Apr 2009 11:36:32 -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: reading members in PDS
I think your problem is the trailing @
You read again and again the same record. That's the use of the trailing
@: read the record and keep it in buffer...
Somewhere in your code you must read the next record. Unfortunately the
code below ends after keeping the record.
It could (should) be like:
INPUT @38 job_nmbr $char8.
@65 job_name $char8.
@76 test $char2. @;
IF job_name =: 'AMBAM' then do;
IF test = 'ST' then do;
.....
input ... the rest of the record ...;
end;
end;
else input; /* read the next record, because it was not the right
one...*/
if you keep on reading the first record (only INPUTs with @) DONE will
never become true.
Gerhard
On Mon, 27 Apr 2009 08:02:02 -0700, jaheuk <hejacobs@GMAIL.COM> wrote:
>dear all,
>i found some examples of reading members in a pds based on a
>predefined list.
>I do not succeed in it!!
>Job seems to be in a loop or something, keeps hanging on the first
>file.
>attached a piece of my code:
>
>...............................
>DATA memlist;
> INFILE indata;
> INPUT @1 mem2read $6.;
> fil2read = 'D2RWV.TEXTLIB.NACHT('!!compress(mem2read)!!')' ;
> keep fil2read;
>RUN;
>
>DATA work01;
> SET memlist;
>
> INFILE dummy filevar=fil2read end=done ;
>
> DO while(NOT done);
> INPUT @38 job_nmbr $char8.
> @65 job_name $char8.
> @76 test $char2. @;
> IF job_name =: 'AMBAM' then do;
> IF test = 'ST' then do;
>....................
>
>Regards,
>Herman