I have a data file of 15000 records that comes in with a trailer record that contains the following:
RECORD COUNT: 000000015000.
My JCL should do the following:
Step 1 - It should count the number of records in the data file EXCLUDING the trailer record
Step 2 - See if the count in Step1 is the same as the record count in trailer record.
If unequal, it should set the MAXCC to 8.
If equal, it should set the MAXCC to 0 and continue processing the rest of the JCL.
In order to achieve Step 2, I want to extract the record count as 12-digits into a dataset DS1 from Step 1 so that I can match up with the record count I get from the trailer record (which I plan to extract into a dataset DS2).
My Step 2 will be just a superc between DS1 and DS2 so that it's an exact match in case the 12-digits are the same.
My problem is:
1. I can't get the digits to extract into a dataset with the JCL below. I receive the error messages shown to which I can't find supporting documentation as well.
2. In the sysout (when I dont use the TO word, I get a 15 digit output. I wonder how I can truncate that to a 12 digits value?? )
SYT000I SYNCTOOL RELEASE 1.5.2 - COPYRIGHT 2004 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
COUNT FROM(IN) TO(OUT) USING(CTL1)
SYT050E INVALID OPERAND ON "COUNT" STATEMENT
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12
Thanks,
Sonycec
P.S. I did search the forum high and low and the best I could get to was DFSORT documentation but unfortunately, not SYNCTOOL's documentation. I am hoping someone will save my day!
Thanks for your email, Arun. The input RECFM is a GDG base of LRECL 1600. The last record in that GDG will contain the number of data records in that file. So which means, if it contains 15000 records, the trailer would be:
Code:
RECORD COUNT=000000015000
This is something we don't have control over as we receive this from an external source.
When I run an ICETOOL to get the count of records in the step above, I get a 15-digit value with leading zeroes. Hope I have answered your questions.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
Thanks for your email, Arun
Email?
Quote:
The input RECFM is a GDG base of LRECL 1600
GDG base is not a RECFM. A single gdg base can have gdgs of different RECFMs. In your case, it might be something like FB,FBA,VB,VBA etc...You need to mention which is yours.
I m still not clear what exactly you are trying. Your trailer record has the record count. What value you need to compare this to? A constant? Or something else.
Please explain what you are trying to do.
Thanks for the "reply", Arun! (I hardly realized until you pointed it out..)
To answer your question, the RECFM is FB. This means my code for the input dataset would look like:
Code:
//IN DD DSN=TEST.ORIG.FILE(0),DISP=SHR
This is what I am trying to do. I get a file from an external source and there's a record count in the trailer record. BEFORE I can do any more processing on the file, I have to verify at my end whether the record count I have received in the trailer record actually tallies with the number of records (which I try to find by using the COUNT option in SYNCTOOL). This is what I am trying to accomplish.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Sonycec,
I m not connected to mainframe and can't test this now. You can give this a try. This Syncsort application should give a RC=0 when the count matches and a RC=4 when it does n't. Please get back if you face issues. Good luck
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
(I hardly realized until you pointed it out..)
Yup, the notificaton was an e-mail. . . Kinda like getting an e-mail telling you there is a voice mail elsewhere
If your system is processing input files that might have an actual record count that is not the same as the computed total records, i believe there is some kind of major problem that should be addressed. . .
There is no reason for this to ever happen. If a file ever "arrived" with the count incorrect, there should be a rule that what must be done at file creation is the record count be checked before the new generation is cataloged and the "bad" generation would never be cataloged as a +1 and thus you would never see it. Prevention is far better than dealing with the bad file after it has been "delivered".
How I wish it was done "before" it reached us but if we were to "assume" that what we receive is authentic, we needn't even do this check in the first place. The situation is someone doesn't want to do this at the other end and would just send it in. You know how clients can be demanding which forces a programmer's mind and soul to convolute into all possible logics to make it happen on our end and thereby not create problems further down the job stream (if any of that made any sense??!! )
Bottom line is it's a hard requirement for us to make this happen and my manager says "dude, make it happen" and hence I helplessley knock on the doors of IBMMAINFRAMES.
Just so you know - There's another alternative I am trying out and if it clicks, I'll post it ASAP and close this thread.
It went down due to a syntax error. Here's the job output:
Code:
SYNCSORT FOR Z/OS 1.2.2.2R U.S. PATENTS: 4210961, 5117495 (C)
z/OS 1.8.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 53C8A, MODEL 2094 606
SYSIN :
OPTION NULLOFL=RC4
*
INREC BUILD=(1,26,SEQNUM,12,ZD,START=0)
OUTFIL FNAMES=OUT,
INCLUDE=(1,12,CH,EQ,C'RECORD COUNT',AND,
(14,12,ZD,EQ,27,12,ZD))
WER268A OPTION STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
I am trying to understand and rectify this error but I don't have the manuals to Syncsort. I am hoping this error would make more sense to you. Please do send me the manuals if you do have them.
At this point, we are attempting to compare two datasets with entries:
000000015000. How about obtaining the actual values into the dataset (i.e. 15000)? For this, the parse function in DFSORT would have helped but for some reason, it is not supported in SYNCTOOL. My question is what is the counterpart function that substitutes for the PARSE function?
I am also confused at why would i get another version number here:
Code:
SYNCSORT FOR Z/OS 1.2.2.2R
. In my first post, my sysout had
Code:
SYNCTOOL RELEASE 1.5.2
Would there be any connection to why OPTION NULLOFL=RC4 didn't worked? Anyone?
The same, Arun. The error still hovers under NULLOFL. Forgive my ignorance but in my web searches, NULLOFL seems to be connected to DFSORT than SYNCTOOL. Please feel free to correct me if I am heading in the wrong direction but we need to pin this creature down.
Code:
SYNCSORT FOR Z/OS 1.2.2.2R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.8.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 53C8A, MODEL 2094 606 LICEN
SYSIN :
OPTION COPY,NULLOFL=RC4
*
INREC BUILD=(1,26,SEQNUM,12,ZD,START=0)
OUTFIL FNAMES=OUT,
INCLUDE=(1,12,CH,EQ,C'RECORD COUNT',AND,
(14,12,ZD,EQ,27,12,ZD))
WER268A OPTION STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Sonycec,
I m sure this would work with Syncsort as well, but may be the syntax is wrong. I have extensively used this option but only via PARM. Alternatively you can specify it in parm like this,
Hi Dick,
Thanks for the pointer on the OUTFIL thing. Your advice worked.
Hi Arun,
Simple and elegant sort card logic, you provided! It's alive!!! Here's the latest sort card without the PARM (I had to tweak the LRECL and BLKSIZE to 38 for it to work):
When I stand back and look at the sort card, it looked like a simple one but sometimes, one just hits a deadend with the same perspective. Once again, all credit to Arun!
My day has just been saved! Thank you Arun!
Thanks IBM Mainframes! Thanks all!
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Sonycec,
You're welcome. Glad to hear it's working for you. Unless you use the "original count" file somewhere else, I would personally suggest routing the output to SYSOUT instead of writing into a file since our prime objective is to verify the trailer count.
Just a few thoughts on some points raised in this thread.
Quote:
the parse function in DFSORT would have helped but for some reason, it is not supported in SYNCTOOL. My question is what is the counterpart function that substitutes for the PARSE function?
Quote:
NULLOFL seems to be connected to DFSORT than SYNCTOOL
Syncsort does support NULLOFL and PARSE. PARSE function is supported by Syncsort for z/OS Release 1.3 or above.
sonycec wrote:
I am also confused at why would i get another version number here:
Code:
SYNCSORT FOR Z/OS 1.2.2.2R
. In my first post, my sysout had
Code:
SYNCTOOL RELEASE 1.5.2
Your first job was a SYNCTOOL application where as the second one was a SYNCSORT job. SYNCTOOL is an additional package supplied by Syncsort which has a lot more functionalities and both have their own control statements. I would suggest going through the Syncsort manual to get to know more about this. If you dont have one, you can contact Syncsort Support or PM Alissa.