You could try this. It seems to read these two records. I tried to put in something to account for mulitple pages, but no way to test if it works. The account descriptions and ID numbers listed below each transaction where not consistently formatted between your two records, so I decided to output those into a separated dataset. I assumed that the TRAN_NO could serve as a key to link the records back together. data company(keep=tran_no company_name db_cr_amount db curr appdt apptm tran_id rn payment_method trdt trtm ) company_account(keep=tran_no acctype acctid) ; infile src end=eof truncover ; input @ ; if (_n_=1 or index(_infile_,'0c'x)) then do until(eof or _infile_=:'----'); input / @; end; if _infile_=:'----' or _infile_=' ' then input / @ ; *-----------------------------------------------------------------------------; * Read one company report ; *-----------------------------------------------------------------------------; input tran_no 1-8 company_name $12-35 db_cr_amount : comma15. db $ curr $ appdt date7. apptm time8. / tran_id $ 1-9 rn $ 11 payment_method $ 13-64 trdt date7. trtm time8. ; format appdt trdt date9. apptm trtm time8. db_cr_amount comma15.2 ; output company; *-----------------------------------------------------------------------------; * Read the account numbers ; *-----------------------------------------------------------------------------; do until (_infile_=' ' or eof) ; input / @; if _infile_ ne ' ' then do; acctype = left(scan(_infile_,1,':')); acctid = left(scan(_infile_,2,':')); output company_account; end; end; run; proc print data=company width=min; run; proc print data=company_account width=min; run;
... View more