For Programmers: Free Programming Magazines  


Home > Archive > Cobol > April 2005 > JCL to compare counts









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JCL to compare counts
dharmadam_man@hotmail.com

2005-04-19, 3:55 pm

I would like to do the following in a JCL using ICETOOL or any other
standard tools available.

I have a dataset with the last record (trailer record) containing
number of records in the dataset excluding the trailer.
I would like to count the number of records (excluding the trailer
record) and compare the number with the value stored as the first 13
bytes of the trailer record. If both numbers are equal, I would like to
set the RC = 0 in the JCL.

Example
DRU034
CPC045
RFK056
000000003

yaeger@us.ibm.com

2005-04-19, 3:55 pm

dharmadam_man@hotmail.com wrote:
> I would like to do the following in a JCL using ICETOOL or any other
> standard tools available.
>
> I have a dataset with the last record (trailer record) containing
> number of records in the dataset excluding the trailer.
> I would like to count the number of records (excluding the trailer
> record) and compare the number with the value stored as the first 13
> bytes of the trailer record. If both numbers are equal, I would like

to
> set the RC = 0 in the JCL.
>
> Example
> DRU034
> CPC045
> RFK056
> 000000003


You said the value is stored as the first 13 bytes of the trailer
record, but your example show only 9 bytes. Assuming that the count in
the trailer record is really in bytes 1-13, you can use this
DFSORT/ICETOOL job below to set RC=0 if the trailer count equals the
data record count - 1 or RC=12 if they aren't equal. You'll need z/OS
DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) to use
DFSORT's new COUNT-n=(edit/to) parameter. If you have DFSORT, but you
don't have the Dec, 2004 PTF installed, ask your System Programmer to
install it (it's free). For complete details on all of the new DFSORT
and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support.../sort/mvs/pdug/

Here's the DFSORT/ICETOOL job. If you want RC=4 instead of RC=12, add
RC4 to the COUNT operator:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&& T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,P
ASS)
//TOOLIN DD *
* Create an output record in T1 with:
* xxxxxxxxxxxxx yyyyyyyyyyyyy
* where x...x is the trailer count and y...y is the data count - 1.
COPY FROM(IN) USING(CTL1)
* If the counts are equal, set RC=0.
* If the counts are not equal, set RC=12.
COUNT FROM(T1) EMPTY USING(CTL2)
* If you want RC=4 instead of RC=12, change the
* COUNT operator to:
* COUNT FROM(T1) EMPTY USING(CTL2) RC4
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
TRAILER1=(1,13,15:COUNT-1=(M11,LENGTH=13))
/*
//CTL2CNTL DD *
INCLUDE COND=(1,13,ZD,EQ,15,13,ZD)
/*

Frank Yaeger - DFSORT Team (IBM) - yaeger@us.ibm.com
Specialties: ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

dharmadam_man@hotmail.com

2005-04-19, 8:55 pm

Thanks for the quick response. It was a mistake on my part to include
all 13 bytes in the trailer record.

Unfortunately, I think, we don't have the latest version. I was getting
the following message.
SYNCSORT FOR Z/OS 1.1DNI TPF3 U.S. PATENTS: 4210961, 5117495 (C)
2002 SYNC
AFFILIATED COMPUTER SERVICES z/OS
1.4.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 9310F, MODEL 2064 110
LICEN
CTL1CNTL :

OUTFIL FNAMES=3DT1,REMOVECC,NODETAIL,

TRAILER1=3D(1,13,15:COUNT-1=3D(M11 ,LENGTH=3D13))

*

WER428I CALLER-PROVIDED IDENTIFIER IS "0001"

WER268A OUTFIL STATEMENT : SYNTAX ERROR



My JCL is included

//QCPI039S JOB (3CCP911525RBL),'SORT',
// CLASS=3DG,MSGCLASS=3DX,MSGLEVEL=3D(1,1),

// NOTIFY=3DQCPI039
//*
//S1 EXEC PGM=3DICETOOL
//TOOLMSG DD SYSOUT=3D*
//DFSMSG DD SYSOUT=3D*
//IN DD DSN=3DQCPJNT.DWP.CCR.TRXCLAIM.EXTERNAL.G0018V00,
// DISP=3DSHR
//T1 DD DSN=3DQCPJNT.DWP.CCR.TRXCLAIM.EXTERNAL.DATA,
// DISP=3D(NEW,CATLG,CATLG),
// UNIT=3DSYSDA,
// SPACE=3D(CYL,(800,5),RLSE),
// DCB=3D(ACSNS. DSCB,BLKSIZE=3D0,LRECL=3D700,RECFM=3DFB)

//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) EMPTY USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=3DT1,REMOVECC,NODETAIL,
TRAILER1=3D(1,13,15:COUNT-1=3D(M11=AD,LENGTH=3D13))
/*
//CTL2CNTL DD *
INCLUDE COND=3D(1,13,ZD,EQ,15,13,ZD)
/*

William M. Klein

2005-04-19, 8:55 pm

OH ...

You have SyncSort and NOT DFSort.

"ICETOOL" (I believe) is a DFSort only product. I think SyncSort has a similar
feature, but not called that. As Frank works for IBM - on DFSort, he is not the
right person to ask about SyncSort questions. Hopefully someone else will reply
from that product.

--
Bill Klein
wmklein <at> ix.netcom.com
<dharmadam_man@hotmail.com> wrote in message
news:1113943618.340713.235130@l41g2000cwc.googlegroups.com...
Thanks for the quick response. It was a mistake on my part to include
all 13 bytes in the trailer record.

Unfortunately, I think, we don't have the latest version. I was getting
the following message.
SYNCSORT FOR Z/OS 1.1DNI TPF3 U.S. PATENTS: 4210961, 5117495 (C)
2002 SYNC
AFFILIATED COMPUTER SERVICES z/OS
1.4.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 9310F, MODEL 2064 110
LICEN
CTL1CNTL :

OUTFIL FNAMES=T1,REMOVECC,NODETAIL,

TRAILER1=(1,13,15:COUNT-1=(M11 ,LENGTH=13))

*

WER428I CALLER-PROVIDED IDENTIFIER IS "0001"

WER268A OUTFIL STATEMENT : SYNTAX ERROR



My JCL is included

//QCPI039S JOB (3CCP911525RBL),'SORT',
// CLASS=G,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=QCPI039
//*
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=QCPJNT.DWP.CCR.TRXCLAIM.EXTERNAL.G0018V00,
// DISP=SHR
//T1 DD DSN=QCPJNT.DWP.CCR.TRXCLAIM.EXTERNAL.DATA,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(800,5),RLSE),
// DCB=(ACSNS.DSCB,BLKSIZE=0,LRECL=700,RECFM=FB)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) EMPTY USING(CTL2)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
TRAILER1=(1,13,15:COUNT-1=(M11_,LENGTH=13))
/*
//CTL2CNTL DD *
INCLUDE COND=(1,13,ZD,EQ,15,13,ZD)
/*


yaeger@us.ibm.com

2005-04-20, 3:55 pm

dharmadam_man@hotmail.com wrote:
> Thanks for the quick response. It was a mistake on my part to include
> all 13 bytes in the trailer record.
>
> Unfortunately, I think, we don't have the latest version. I was

getting
> the following message.
> SYNCSORT FOR Z/OS 1.1DNI TPF3 U.S. PATENTS: 4210961, 5117495 (C)
> 2002 SYNC
> AFFILIATED COMPUTER SERVICES

z/OS
> 1.4.0
> PRODUCT LICENSED FOR CPU SERIAL NUMBER 9310F, MODEL 2064 110
> LICEN
> CTL1CNTL :
>
> OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
>
> TRAILER1=(1,13,15:COUNT-1=(M11 ,LENGTH=13))
>
> *
>
> WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
>
> WER268A OUTFIL STATEMENT : SYNTAX ERROR


The job I posted works fine with DFSORT's ICETOOL. But you're using
Syncsort, not DFSORT. COUNT-n=(edit/to) and COUNT+n=(edit/to) are
exclusive DFSORT functions. You can't use them with Syncsort. As a
DFSORT developer, I'm happy to answer questions on DFSORT and DFSORT's
ICETOOL, but I don't answer questions on Syncsort.

Frank Yaeger - DFSORT Team (IBM) - yaeger@us.ibm.com
Specialties: ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com