Since the outcome of the program is not exactly clear, I made one up myself, but it might give you a hint on the techniques to use. With the trailing @ sign in the INPUT statement you can read a line from the file and keep it in the input buffer, so the next INPUT statement will read from the same input buffer. I made up two record types, on that determines the beginning of a block of lines and one that ends the block of lines to read. Have a look, it might help you to get started with what you need. data want; infile cards truncover; * read record Type and keep input record ; input @1 recType $4. @ ; * check for beginning of lines to read ; if recType = "@I01" then do; retain readLine; readLine = 1; end; * check for end of lines to read ; if recType = "@A" then do; retain readLine; readLine = 0; end; * read lines and write to output ; if readLine = 1 then do; input @1 textLine $32. ; output; end; cards4; :R: John Smith, 999-7543,
[email protected] :I: //Q XYZRTSWPQ NSPRQLQ //N L 01WOW13 @T !BRR 08;LIM 20 @01@?30@02 !BRR -100;LIM 0 !LIM 68;BRR 2 @03 @A Dear CompanyName Street Name Town Name County Post Code @I01100100100 @I02robqqgzr @I03100100100 @A Dear CompanyNAme Street Name Town Name County PostCode @I01200200200 @I02robfxmal @I03200200200 @A ;;;;
... View more