Hi,
I need to calculate the records count in a file and need to update in trailer using JCL SORT.
please chk my requirement below.
My JCl having 2 steps. in 1 step main file will create and same file will split in to multiple(12) files in 2nd step.
Main file will have the Headedr and trailer with record count. am copieing the header and trailer of main file record into all files.
But i need to correct the Trailer record count.
i traied as below, but am getting Max-16
//PS030 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN DD DSN=DSTG0.PDS.OHCB.MM.EXTRACT.OUTPUT.MM.Z1,DISP=SHR
//SORTOF01 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM01,
// DISP=SHR
//SORTOF02 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM02,
// DISP=SHR
//SORTOF03 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM03,
// DISP=SHR
//SORTOF04 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM04,
// DISP=SHR
//SORTOF05 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM05,
// DISP=SHR
//SORTOF06 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM06,
// DISP=SHR
//SORTOF07 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM07,
// DISP=SHR
//SORTOF08 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM08,
// DISP=SHR
//SORTOF09 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM09,
// DISP=SHR
//SORTOF10 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM10,
// DISP=SHR
//SORTOF11 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM11,
// DISP=SHR
//SORTOF12 DD DSN=DSTG0.PDS.HCB.MM.EXT.MM12,
// DISP=SHR
//SYSIN DD *
OPTION COPY
OUTFIL FILES=01,INCLUDE=(63,4,ZD,EQ,1,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=02,INCLUDE=(63,4,ZD,EQ,2,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=03,INCLUDE=(63,4,ZD,EQ,3,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=04,INCLUDE=(63,4,ZD,EQ,4,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=05,INCLUDE=(63,4,ZD,EQ,5,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=06,INCLUDE=(63,4,ZD,EQ,6,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=07,INCLUDE=(63,4,ZD,EQ,7,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=08,INCLUDE=(63,4,ZD,EQ,8,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=09,INCLUDE=(63,4,ZD,EQ,9,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'T')
TRLUPD=(2:COUNT=(M11,LENGTH=18)
added the trailer update for file 09, but it's not working.
could you please help m on the same.
FILE Lay out
AGNMMEXTR2012-05-040000002014-06-18-07.20.57.129385
D |MMGNDA0050000000 Á 99991234567892000000000116722
D êMMGNDA0050000000 Á 99991234567892000000000117182
D ëMMGNDA0050000000 Á 99991234567892000000000117522
D íMMGNDA0050000000 Á 99991234567892000000000117522
D îMMGNDA0115000000 Á 99991234567892000000001623319
Z000000000000000016
A - HEADER
D - DETAILED
Z - TRAILER
Trasiler length is 18[/code]
Record Count in JCL
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 3
- Joined: Wed Jun 18, 2014 5:43 pm
Hi William
Thanks for your replay.
I changed the C'T' as C'Z', but geeting the same error.
Please find spool data.
OUTFIL FILES=10,INCLUDE=(63,4,ZD,EQ,10,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),
*
TRLUPD=(2:COUNT=(M11,LENGTH=1
*
OUTFIL FILES=11,INCLUDE=(63,4,ZD,EQ,11,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=12,INCLUDE=(63,4,ZD,EQ,12,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
WER901I **WARNING** SYNCSORT 1.4.0.1 WILL EXPIRE IN 50 DAYS
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Thanks for your replay.
I changed the C'T' as C'Z', but geeting the same error.
Please find spool data.
OUTFIL FILES=10,INCLUDE=(63,4,ZD,EQ,10,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),
*
TRLUPD=(2:COUNT=(M11,LENGTH=1
*
OUTFIL FILES=11,INCLUDE=(63,4,ZD,EQ,11,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
OUTFIL FILES=12,INCLUDE=(63,4,ZD,EQ,12,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z')
WER901I **WARNING** SYNCSORT 1.4.0.1 WILL EXPIRE IN 50 DAYS
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
When you look at the sysout, the * will show you the point at which SyncSort has identified that there is an error.
You didn't fix the missing comma. There is a second one. A missing closing bracket.
When pasting here, you need to use the Code tags for anything requiring that spacing is preserve spacing. I can't tell where the * are pointing to.
You didn't fix the missing comma. There is a second one. A missing closing bracket.
When pasting here, you need to use the Code tags for anything requiring that spacing is preserve spacing. I can't tell where the * are pointing to.
After looking at your Input file & Sysin.it looks like you are copying only Header and trailer in all your outfile. this will give you Count= 0000000 .
also William suggested you well for your error.
use this--
OUTFIL FILES=09,INCLUDE=(63,4,ZD,EQ,9,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z'),
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),
TRLUPD=(2:COUNT=(M11,LENGTH=18)))
also William suggested you well for your error.
use this--
OUTFIL FILES=09,INCLUDE=(63,4,ZD,EQ,9,OR,1,1,CH,EQ,C'A',
OR,1,1,CH,EQ,C'Z'),
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),
TRLUPD=(2:COUNT=(M11,LENGTH=18)))
Thanks,
--Dhiraj Mishra
--Dhiraj Mishra
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page