IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can SYNCTOOL extract record count &format it into a data


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 3:10 am
Reply with quote

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?? )

Code:

//JS0010   EXEC PGM=IEFBR14,                                     
//         COND=(0,NE)                                           
//DD001    DD  DSN=MPDT.NONX.MPD647NR.NRTHEAST.ORGCNT,           
//             DISP=(MOD,DELETE,DELETE),UNIT=TESTDA,SPACE=(TRK,0)
//*                                                             
//JS0020 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN       DD DSN=TEST.ORIG.FILE,DISP=SHR 
//OUT1     DD DSN=TEST.ORIG.FILE.CNT,           
//            DISP=(NEW,CATLG,DELETE),                           
//            UNIT=TESTDA,                                       
//            SPACE=(TRK,(1,1)),                                 
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0)         
//TOOLIN   DD *                                                 
COUNT FROM(IN) TO(OUT1) USING(CTL1)                             
/*                                                               
//CTL1CNTL DD *                                                 
 OMIT COND=(1,12,CH,EQ,C'RECORD COUNT')                         
/*


and the error message in the sysout says:
Code:

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!
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 7:23 am
Reply with quote

Hello sonycec,

Welcome to the forums,

Can you post your input RECFM and LRECL? Are you trying to compare the input record count against a constant value=15000?
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 8:19 am
Reply with quote

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.

Thanks,
Sonycec
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 8:43 am
Reply with quote

Quote:
Thanks for your email, Arun

Email? icon_eek.gif
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.
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 8:49 am
Reply with quote

Thanks for the "reply", Arun! icon_smile.gif (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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 9:28 am
Reply with quote

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 icon_smile.gif
Code:
//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DSN=Input file
//OUT     DD SYSOUT=*
//SYSIN   DD *
  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))
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Nov 30, 2008 9:37 am
Reply with quote

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 icon_smile.gif

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".

IMHO. . .
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 9:47 am
Reply with quote

Hi Dick,

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??!! icon_lol.gif )

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.

Thanks for all the support!

Best regards,
Sonycec
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Nov 30, 2008 9:55 am
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 10:01 am
Reply with quote

Hi Arun,

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?

Thanks
Sonycec
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 10:06 am
Reply with quote

Can you change that statement to
Code:
OPTION COPY,NULLOFL=RC4
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 10:11 am
Reply with quote

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                                 
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Nov 30, 2008 10:18 am
Reply with quote

Hello,

I believe this "NULLOFL=RC4" needs to be part of the OUTFIL statement.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 10:20 am
Reply with quote

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,

Code:
//STEP1 EXEC PGM=SORT,PARM='NULLOFL=RC4'
//........
//SYSIN DD *
  OPTION COPY
  .....
  .....
Back to top
View user's profile Send private message
sonycec

New User


Joined: 26 Nov 2008
Posts: 7
Location: California

PostPosted: Sun Nov 30, 2008 12:54 pm
Reply with quote

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):

Code:

//JS0010 EXEC PGM=SORT                                         
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=inputfile,DISP=SHR
//OUT     DD DSN=inputfile.ORGCNT,           
//           DISP=(NEW,CATLG,DELETE),                           
//           UNIT=TESTDA,                                       
//           SPACE=(TRK,(1,1)),                                 
//           DCB=(DSORG=PS,RECFM=FB,LRECL=38,BLKSIZE=38)       
//SYSIN   DD *                                                 
  OPTION COPY                                                   
  INREC BUILD=(1,26,SEQNUM,12,ZD,START=0)                       
  OUTFIL FNAMES=OUT,NULLOFL=RC4,                               
         INCLUDE=(1,14,CH,EQ,C'RECORD COUNT :',AND,             
                 (15,12,ZD,EQ,27,12,ZD))                       
/*                                                             



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!

This thread can be closed (if required).
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Nov 30, 2008 5:12 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts db2 vs static data COBOL Programming 1
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
Search our Forums:

Back to Top