Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEED TO PRINT RECORDS FROM AN ARRAY

Status
Not open for further replies.

GOUSC

Programmer
Nov 25, 2002
5
US
I am really new to SAS am working on a mainframe program that reads in data that has several occurs (the copybook is a COBOL layout) and I have the following code :

I=0;
DO while (I <= carr_edit_cd_cnt);
INPUT
@AT edit_trlr_ind_cd $1.
@AT+1 nch_edit_cd $char4.
@;
AT=AT+5;
I=I+1;
END;

This appears to be correct, but when I put the dataout, I am only seeing the one record when I know that the carr_edit_cd_cnt has a value of 3. Do I need to write out separate datasets as I go and merge later or do I have to do the similar array on the put statement? Any help would be greatly appreciated.

Thanks.

GoUSC
 
Hi GoUSC,

I guess you miss the output statement - if you do not do that, you end up in above example with one observation? Do something like this:

Code:
 I=0;
 DO while (I <= carr_edit_cd_cnt);
   INPUT
     @AT        edit_trlr_ind_cd  $1.
     @AT+1      nch_edit_cd       $char4.
     @;
   AT=AT+5;
   I=I+1;
   output;
 END;

... assuming that you write to a dataset...

Cheers,
Matthias
 
Thanks MatthiasB. I realized this after I posted the message. I appreciate your help. I just didn't realize this since SAS is so new to me but I am learning slowly.

Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top