Record Count in JCL

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
naresh1220
Member
Posts: 3
Joined: Wed Jun 18, 2014 5:43 pm

Record Count in JCL

Post by naresh1220 » Wed Jun 18, 2014 6:00 pm

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]

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Jun 18, 2014 10:50 pm

You seem to have a comma missing, C'T'), and if your trailer starts with Z, why are you testing for T.

If you have errors, we need to see the sysout, else we're just guessing.

naresh1220
Member
Posts: 3
Joined: Wed Jun 18, 2014 5:43 pm

Post by naresh1220 » Thu Jun 19, 2014 10:31 am

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

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Jun 19, 2014 12:18 pm

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.

dhiraj
Member
Posts: 48
Joined: Tue May 06, 2014 11:22 am

Post by dhiraj » Fri Jun 20, 2014 2:49 pm

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)))
Thanks,
--Dhiraj Mishra

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun Jun 22, 2014 11:46 pm

And what is wrong with with posting sort queries in the sort part of the forum. JCL is not sort.
Regards
Nic

Post Reply

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



Other References
Mainframe Tools and others