Is there a parameter for sort programme to exclude (ignore) the first line of a file from sorting in jcl.
Thanks,
If your Sort level is up-to-date, you can use DATASORT. Borrowed from an answer by Frank Yaeger, via google.
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
FIRST
AAAA
CCCC
DDDD
FFFF
GGGG
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A)
/*
You can try the following:
//SYSIN DD *
SORT FIELDS=...
SKIPREC=1
/*
You may have to do a sort copy and in a subsequent JCL step do the sort.
Try using the ICETOOL SUBSET operator. Here is a really simple example:
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD * -- Unsorted input data...
FIRST LINE
5
6
7
1
4
/*
//TOOLIN DD * -- ICETOOL commands
SUBSET FROM(IN1) TO(OUT1) REMOVE INPUT HEADER
/*
//OUT1 DD SYSOUT=* -- Sorted output goes here
Upon completion OUT1
contains:
1
4
5
6
7
which are the data from IN1
, sorted, missing the first input line.
The DFSORT/ICETOOL manual can be found here and the ICETOOL SUBSET operator is documented here
edit
Based on your comment to Gilbert, I suggest using a second job step to IDCAMS REPRO (copy) the first record from the original input file and then concatenate it to the ICETOOL output. The JCL is relatively straight forward.