Page 1 of 1

Removing Header and Trailers

Posted: Wed Sep 02, 2015 6:30 pm
by logon2shashi
Hi,

I have 10 PS files. All files contains Headers and Trailers with some data.

Now, i need all the data in a combined single file with only one header and one trailer. All other 9 headers and 9 trailers should be deleted.

Also at end, i want the total number of records present in that single file.

Could you please help me, how to write a sort card for this ?

Posted: Wed Sep 02, 2015 6:49 pm
by William Collins
What do the existing headers and trailers look like, and those that you want at the end?

Posted: Wed Sep 02, 2015 7:06 pm
by logon2shashi
NAME AGE LOCATION --> HEADER
ABC 20 XYZ
DEF 21 ZZZ
GHI 22 GGG
<END OF RECORDS> --> TRAILER


So, i just need only one header and one trailer and skip remaining 9 when combined in a single file with total number of records at last.

Posted: Wed Sep 02, 2015 7:45 pm
by William Collins
Concatenate your 10 datasets on SORTIN, OMIT COND= for all the headers and trailers, and use OUTFIL HEADER1, TRAILER1, REMOVECC to make new headers and trailers. COUNT is available if you need the count of records.