In the above code my input files are of VB format and RECL length is 32756. Even my output is of same VB format and RECl length is 32756.
All the 3 input files have header and trailer. So first i am removing the header and trailer from the input files and copying the date records to temp.
And later from temp to output file by creating header and trailer.
But it is throwing error as below.
Code:
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 12:28 ON FRI NOV
SORT FIELDS=(5,2,CH,A,7,20,CH,A,27,20,CH,A,114,1,CH,A,47,3,CH,A,
50,4,CH,A,54,20,CH,A,74,20,CH,A)
OUTFIL FNAMES=OUTPUT,REMOVECC,
HEADER1=(5:X'0000',
DATENS=(DM4)),
TRAILER1=(5:X'FFFF',
COUNT=(M11,LENGTH=08)),
OUTREC=(5:5,32752)
£
REFORMATTING FIELD ERROR
END OF STATEMENTS FROM CNT2CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CNT2,SORTIN=TEMP,
ORTOUT=OUTPUT,DYNALLOC
SORT FIELDS=COPY
C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698
END OF DFSORT
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Your OUTREC operand is invalid because it doesn't contain the RDW and specifies an input field that's beyond the end of the input file.
Since you're just copying the entire input record, you don't need the OUTREC operand. Note that you also don't need a separate COPY operator for the INCLUDE statement.
The code is working fine.
For all the 3 input files i had header and trailer.
While i am creating header in my putput file i am taking the current date. But i need the entire header of the first input file.
how can i take the entire header of my first input file and and populate as the header of my output file.
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi Frank,
When i am trying the run tha above SORT it is abending. And the error is as follows.
Code:
OMIT COND=(5,2,CH,EQ,X'FFFF') 00170
SORT FIELDS=(5,2,CH,A,7,20,CH,A,27,20,CH,A,114,1,CH,A,47,3,CH,A, 00180
50,4,CH,A,54,20,CH,A,74,20,CH,A) 00190
OUTREC BUILD=(1,4,5:SEQNUM,1,ZD,6:5) 00200
OUTFIL FNAMES=OUTPUT,REMOVECC, 00210
OMIT=(6,2,BI,EQ,X'0000',AND,5,1,ZD,GT,+1), 00220
BUILD=(1,4,5:6), 00230
TRAILER1=(5:X'FFFF', 00240
COUNT-1=(M11,LENGTH=08)) 00250
RECORD TYPE IS V - DATA STARTS IN POSITION 5
VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
TTOI36N .STEP010 . , INPUT LRECL = 32756, BLKSIZE = 32760, TYPE = VB
OPTIONS: NULLOUT=RC0
EXCP ACCESS METHOD USED FOR SORTIN
14 BYTE VARIABLE RECORD IS SHORTER THAN 114 BYTE MINIMUM FOR FIELDS
END OF DFSORT
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
As the error message indicates, you have records that do not have all of your sort fields. You're trying to sort on position 114, but you have a record that's only 14 bytes long. VLSHRT would normally take care of this, but it can't be used with the OUTREC statement. So you'll need to use two passes with a DFSORT/ICETOOL job like this: