How to Sort Input Data set without Header and Trailer

The logic is again in two ways:

Method-1
Use IDCAMS utility skip header record and trailer record.

IDCAMS Skip record code snippet:
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
Skip(1)count(48)
/*

Method-2

Use IFTHEN in sort on input file, that is INREC. That means you need to reformat input record without header and trailer. This way you will get a data set without header and trailer.

Code snippet to reformat input record in sort JCL

// EXEC PGM=SORT
//SYSIN DD *

INREC IFTHEN=(WHEN=(1,5,CH,EQ,C’TYPE1′),
BUILD=(1,40,C’**’,+1,TO=PD)),
IFTHEN=(WHEN=(1,5,CH,EQ,C’TYPE2′),
BUILD=(1,40,+2,TO=PD,X’FFFF’)),
IFTHEN=(WHEN=NONE,OVERLAY=(45:C’NONE’))

/*

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.