suma_infy
New User
Joined: 03 Oct 2008 Posts: 25 Location: chennai
|
|
|
|
hello,
i'm learning DFSORT using IBM manuals. I tried a sample job to create a report.
i/p file length:80 record format : FB
Code: |
//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),
// SPACE=(TRK,(1,1),RLSE),
// UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1:28,19,21:16,11,33:1,14,48:48,4)
SORT FIELDS=(1,19,CH,A)
OUTFIL FNAMES=SORTOUT,
SECTIONS=(1,19,SKIP=3L,
HEADER3=(3:X,/,
3:'DEPARTMENT : ',1,19,/,X,/,
3:'NUMBER',16:'NAME',31:'PRICE',/,
3:'======',16:'====',31:'====='),
TRAILER3=(3:'======',16:'====',31:'=====',/,
23:'TOTAL:',
31:TOT=(48,6,UFF,EDIT=(I,IT,TTT)))),
OUTREC=(3:21,11,16:33,14,31:48,4,UFF,EDIT=(IITT),40: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.
Suma |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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. |
|