Removing Header and Trailers

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
logon2shashi
Member
Posts: 6
Joined: Wed Sep 02, 2015 6:24 pm

Removing Header and Trailers

Post by logon2shashi » Wed Sep 02, 2015 6:30 pm

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 ?

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Sep 02, 2015 6:49 pm

What do the existing headers and trailers look like, and those that you want at the end?

logon2shashi
Member
Posts: 6
Joined: Wed Sep 02, 2015 6:24 pm

Post by logon2shashi » Wed Sep 02, 2015 7:06 pm

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.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Sep 02, 2015 7:45 pm

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.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others