i'm learning DFSORT using IBM manuals. I tried a sample job to create a report.
i/p file length:80 record format : FB
//TTOISORT JOB 1,CLASS=I,MSGCLASS=X,NOTIFY=&SYSUID
//* RUN THROUGH JCLPREP ON 06/11/2008 AT 04:00:25 BY SIVAKUS FOR QAOS
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=TTOI.SUMA.FILE2,DISP=SHR
//SORTOUT DD DSN=TTOI.SUMA.REPORT.OUTPUT6,DISP=(NEW,CATLG,DELETE),
//SYSOUT DD SYSOUT=*
//SYSIN DD *
3:'DEPARTMENT : ',1,19,/,X,/,
when i tried running this job i got a msg saying
RECORD TYPE IS F - DATA STARTS IN POSITION 1
END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH
Then i changed the Inrec fields as: INREC FIELDS=(1:28,19,21:16,11,33:1,14,48:48,30) - it worked fine.
I tried another thing keeping the inrec fields as same as in the initial and changed the total parameter as 31:TOT=(48,4,UFF,EDIT=(I,ITT)))) - it worked fine.
can anyone give me a clear picture on what has happened in the above job and the record length management.
Thanks in advance.
Your INREC statement ends with 48:48,4. That creates reformatted records that are 51 bytes long.
But your TRAILER3 has 48,6 which tries to copy positions 48-53 from the reformatted record. Since the reformatted record is only 51 bytes long, 48,6 is beyond the end of the reformatted record and you get the error message.
When you use 48:48,30 for the INREC statement, you create reformatted records that are 77 bytes long, so 48,6 works fine.
Using 48,4 in TRAILER3 instead of 48,6 works fine with the original INREC statement because 48,4 copies positions 48-51 from the reformatted record and the reformatted record is 51 bytes long.