Re: Verify record cound against the file trailer [by SORT?]
Peter, My apologies for the typo about not changing the hex notation to character notation for the Trailer include statement. I just modified the control cards to suit your new requirement and forgot to change it in all place. My Bad. Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/28/2016 03:27 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Many thanks once more Sri for your generous help. UFF was indeed the key factor. For the archives, one small correction: INCLUDE=(16,4,CH,EQ,X'0999',AND,$ TRL RECORD Should be: INCLUDE=(16,4,CH,EQ,C'0999',AND,$ TRL RECORD (C'0999" for the trailer, not X'0999'). Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Tuesday, June 28, 2016 4:35 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Peter, It is quite simple to verify the variable length. You just need to use UFF ( Unsigned free format ) instead of ZD which will automatically format the variable value by ignoring any thing other than a numeric and pad it with zeros. Example : //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW SEQNUM,11,ZD, $ RECORD NUMBER 005,15)), $ INDICATOR+COUNT IFTHEN=(WHEN=(16,4,CH,EQ,C'0999'), $ IF TRL RECORD OVERLAY=(5:5,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(16,4,CH,EQ,X'0999',AND,$ TRL RECORD (05,11,UFF,EQ,20,11,UFF)) $ IS COUNT=TRL COUNT? //* Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/28/2016 01:00 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Thanks again Sri, your new version also worked as long as I changed the OUTFIL DD name. Another colleague came to me with this one today. How could we handle variable-length count data in a trailer? For example (RECFM=VB file): ,This is a header 0100,data record 1 0100,data record 2 Etc. 0100,data record 21 0999,21 The last record is a trailer with variable-length data record count. Maximum count field length is 11. TIA for any suggestions you can offer. Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Many thanks once more Sri for your generous help. UFF was indeed the key factor. For the archives, one small correction: INCLUDE=(16,4,CH,EQ,X'0999',AND,$ TRL RECORD Should be: INCLUDE=(16,4,CH,EQ,C'0999',AND,$ TRL RECORD (C'0999" for the trailer, not X'0999'). Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Tuesday, June 28, 2016 4:35 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Peter, It is quite simple to verify the variable length. You just need to use UFF ( Unsigned free format ) instead of ZD which will automatically format the variable value by ignoring any thing other than a numeric and pad it with zeros. Example : //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW SEQNUM,11,ZD, $ RECORD NUMBER 005,15)), $ INDICATOR+COUNT IFTHEN=(WHEN=(16,4,CH,EQ,C'0999'), $ IF TRL RECORD OVERLAY=(5:5,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(16,4,CH,EQ,X'0999',AND,$ TRL RECORD (05,11,UFF,EQ,20,11,UFF)) $ IS COUNT=TRL COUNT? //* Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/28/2016 01:00 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Thanks again Sri, your new version also worked as long as I changed the OUTFIL DD name. Another colleague came to me with this one today. How could we handle variable-length count data in a trailer? For example (RECFM=VB file): ,This is a header 0100,data record 1 0100,data record 2 Etc. 0100,data record 21 0999,21 The last record is a trailer with variable-length data record count. Maximum count field length is 11. TIA for any suggestions you can offer. Peter -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Peter, It is quite simple to verify the variable length. You just need to use UFF ( Unsigned free format ) instead of ZD which will automatically format the variable value by ignoring any thing other than a numeric and pad it with zeros. Example : //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW SEQNUM,11,ZD, $ RECORD NUMBER 005,15)), $ INDICATOR+COUNT IFTHEN=(WHEN=(16,4,CH,EQ,C'0999'), $ IF TRL RECORD OVERLAY=(5:5,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(16,4,CH,EQ,X'0999',AND,$ TRL RECORD (05,11,UFF,EQ,20,11,UFF)) $ IS COUNT=TRL COUNT? //* Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/28/2016 01:00 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Thanks again Sri, your new version also worked as long as I changed the OUTFIL DD name. Another colleague came to me with this one today. How could we handle variable-length count data in a trailer? For example (RECFM=VB file): ,This is a header 0100,data record 1 0100,data record 2 Etc. 0100,data record 21 0999,21 The last record is a trailer with variable-length data record count. Maximum count field length is 11. TIA for any suggestions you can offer. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 8:16 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Peter, Your control cards looks good. I cannot comment on syncsort's NULLOFL behavior. I think Alan had already pointed the obvious. So you control cards should work as expected with that minor tweak. I believe you just need to set the return code if the counts do NOT match and there is no point in making another copy of the dataset. So why not copy only the relevant portions that we need. Some thing like this //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW 005,01,$ INDICATOR SEQNUM,11,ZD, $ RECORD NUMBER 145,11)), $ RECORD COUNT IFTHEN=(WHEN=(5,1,CH,EQ,X'FF'),$ IF TRL RECORD OVERLAY=(6:6,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(5,1,CH,EQ,X'FF',AND, $ TRL RECORD (06,11,ZD,EQ,17,11,ZD)) $ IS COUNT=TRL COUNT? //* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/27/2016 04:03 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Hi Sri, I am a colleague of Victor's, and the initial problem was not stated quite correctly. The input file is RECFM=VB, and the trailer record is identified by X'FF' in the first data position. The record count to be checked in the trailer record is at positions 145-155 (11 digits, ZD). The count in the trailer record does not include either the header record (X'00' in the first position) nor the trailer record, so the count in the trailer record should be the actual record count minus 2. The desired result is to check the trailer count versus the actual data record count and set RC=4 if they do not agree. Unfortunately we do not actually have access to DFSORT any more, only Syncsort. May I ask you to please verify for me that if we were using DFSORT that the control cards below would do what we wish? If so then I can go to our Systems Programmers to open a ticket with Syncsort for assistance in verifying the operation of NULLOFL=RC4 in their product. When I use these control cards with Syncsort, the output file is null (has no records) but Syncsort is not setting RC=4, so I will go to them for support if the control cards I am using should give RC=4. OPTION COPY * ADD SEQNUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) OUTFIL NULLOFL=RC4, INCLUDE=(016,1,BI,EQ,X'FF',AND, (160,11,ZD,EQ,20,11,ZD)), BUILD=(1,4,5:5) Thank you for your
Re: Verify record cound against the file trailer [by SORT?]
Thanks again Sri, your new version also worked as long as I changed the OUTFIL DD name. Another colleague came to me with this one today. How could we handle variable-length count data in a trailer? For example (RECFM=VB file): ,This is a header 0100,data record 1 0100,data record 2 Etc. 0100,data record 21 0999,21 The last record is a trailer with variable-length data record count. Maximum count field length is 11. TIA for any suggestions you can offer. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 8:16 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Peter, Your control cards looks good. I cannot comment on syncsort's NULLOFL behavior. I think Alan had already pointed the obvious. So you control cards should work as expected with that minor tweak. I believe you just need to set the return code if the counts do NOT match and there is no point in making another copy of the dataset. So why not copy only the relevant portions that we need. Some thing like this //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW 005,01,$ INDICATOR SEQNUM,11,ZD, $ RECORD NUMBER 145,11)), $ RECORD COUNT IFTHEN=(WHEN=(5,1,CH,EQ,X'FF'),$ IF TRL RECORD OVERLAY=(6:6,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(5,1,CH,EQ,X'FF',AND, $ TRL RECORD (06,11,ZD,EQ,17,11,ZD)) $ IS COUNT=TRL COUNT? //* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/27/2016 04:03 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Hi Sri, I am a colleague of Victor's, and the initial problem was not stated quite correctly. The input file is RECFM=VB, and the trailer record is identified by X'FF' in the first data position. The record count to be checked in the trailer record is at positions 145-155 (11 digits, ZD). The count in the trailer record does not include either the header record (X'00' in the first position) nor the trailer record, so the count in the trailer record should be the actual record count minus 2. The desired result is to check the trailer count versus the actual data record count and set RC=4 if they do not agree. Unfortunately we do not actually have access to DFSORT any more, only Syncsort. May I ask you to please verify for me that if we were using DFSORT that the control cards below would do what we wish? If so then I can go to our Systems Programmers to open a ticket with Syncsort for assistance in verifying the operation of NULLOFL=RC4 in their product. When I use these control cards with Syncsort, the output file is null (has no records) but Syncsort is not setting RC=4, so I will go to them for support if the control cards I am using should give RC=4. OPTION COPY * ADD SEQNUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) OUTFIL NULLOFL=RC4, INCLUDE=(016,1,BI,EQ,X'FF',AND, (160,11,ZD,EQ,20,11,ZD)), BUILD=(1,4,5:5) Thank you for your generous and expert assistance on this forum. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 3:18 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Victor Gil, It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let m
Re: Verify record cound against the file trailer [by SORT?]
Peter, Your control cards looks good. I cannot comment on syncsort's NULLOFL behavior. I think Alan had already pointed the obvious. So you control cards should work as expected with that minor tweak. I believe you just need to set the return code if the counts do NOT match and there is no point in making another copy of the dataset. So why not copy only the relevant portions that we need. Some thing like this //SYSINDD * OPTION COPY INREC IFTHEN=(WHEN=INIT, BUILD=(1,4, $ RDW 005,01,$ INDICATOR SEQNUM,11,ZD, $ RECORD NUMBER 145,11)), $ RECORD COUNT IFTHEN=(WHEN=(5,1,CH,EQ,X'FF'),$ IF TRL RECORD OVERLAY=(6:6,11,ZD,SUB,+2,M11,LENGTH=11)) $ SUBTRACT 2 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4, INCLUDE=(5,1,CH,EQ,X'FF',AND, $ TRL RECORD (06,11,ZD,EQ,17,11,ZD)) $ IS COUNT=TRL COUNT? //* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation From: "Farley, Peter x23353" <peter.far...@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/27/2016 04:03 PM Subject: Re: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> Hi Sri, I am a colleague of Victor's, and the initial problem was not stated quite correctly. The input file is RECFM=VB, and the trailer record is identified by X'FF' in the first data position. The record count to be checked in the trailer record is at positions 145-155 (11 digits, ZD). The count in the trailer record does not include either the header record (X'00' in the first position) nor the trailer record, so the count in the trailer record should be the actual record count minus 2. The desired result is to check the trailer count versus the actual data record count and set RC=4 if they do not agree. Unfortunately we do not actually have access to DFSORT any more, only Syncsort. May I ask you to please verify for me that if we were using DFSORT that the control cards below would do what we wish? If so then I can go to our Systems Programmers to open a ticket with Syncsort for assistance in verifying the operation of NULLOFL=RC4 in their product. When I use these control cards with Syncsort, the output file is null (has no records) but Syncsort is not setting RC=4, so I will go to them for support if the control cards I am using should give RC=4. OPTION COPY * ADD SEQNUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) OUTFIL NULLOFL=RC4, INCLUDE=(016,1,BI,EQ,X'FF',AND, (160,11,ZD,EQ,20,11,ZD)), BUILD=(1,4,5:5) Thank you for your generous and expert assistance on this forum. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 3:18 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Victor Gil, It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let me know -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu
Re: Verify record cound against the file trailer [by SORT?]
Thank you Alan! That was indeed the problem. I now get RC=4 for an incorrect trailer count, as needed. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Alan Young Sent: Monday, June 27, 2016 7:42 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Hi Peter, The fine print in Syncsort documentation states NULLOFL only applies to non-SORTOUT OUTFIL statements. If I change the DD of SORTOUT to OUT1 and add a FNAMES=OUT1 parameter to the OUTFIL statement then I get a CC 4 from Sri's example. I have not looked at DFSORT documentation in a while but I imagine it does not have this "condition" that Syncsort has that is making it incompatible. Alan Farley, Peter x23353 wrote: > Hi Sri, > > I am a colleague of Victor's, and the initial problem was not stated quite > correctly. The input file is RECFM=VB, and the trailer record is identified > by X'FF' in the first data position. The record count to be checked in the > trailer record is at positions 145-155 (11 digits, ZD). The count in the > trailer record does not include either the header record (X'00' in the first > position) nor the trailer record, so the count in the trailer record should > be the actual record count minus 2. The desired result is to check the > trailer count versus the actual data record count and set RC=4 if they do > not agree. > > Unfortunately we do not actually have access to DFSORT any more, only > Syncsort. May I ask you to please verify for me that if we were using DFSORT > that the control cards below would do what we wish? If so then I can go to > our Systems Programmers to open a ticket with Syncsort for assistance in > verifying the operation of NULLOFL=RC4 in their product. > > When I use these control cards with Syncsort, the output file is null (has no > records) but Syncsort is not setting RC=4, so I will go to them for support > if the control cards I am using should give RC=4. > > OPTION COPY > * ADD SEQNUM BETWEEN RDW AND DATA. > INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), > * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF > * LAST RECORD (IDENTIFIED BY X'FF'). > IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), > OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) > OUTFIL NULLOFL=RC4, > INCLUDE=(016,1,BI,EQ,X'FF',AND, >(160,11,ZD,EQ,20,11,ZD)), > BUILD=(1,4,5:5) > > Thank you for your generous and expert assistance on this forum. > > Peter This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Hi Peter, The fine print in Syncsort documentation states NULLOFL only applies to non-SORTOUT OUTFIL statements. If I change the DD of SORTOUT to OUT1 and add a FNAMES=OUT1 parameter to the OUTFIL statement then I get a CC 4 from Sri's example. I have not looked at DFSORT documentation in a while but I imagine it does not have this "condition" that Syncsort has that is making it incompatible. Alan Farley, Peter x23353 wrote: Hi Sri, I am a colleague of Victor's, and the initial problem was not stated quite correctly. The input file is RECFM=VB, and the trailer record is identified by X'FF' in the first data position. The record count to be checked in the trailer record is at positions 145-155 (11 digits, ZD). The count in the trailer record does not include either the header record (X'00' in the first position) nor the trailer record, so the count in the trailer record should be the actual record count minus 2. The desired result is to check the trailer count versus the actual data record count and set RC=4 if they do not agree. Unfortunately we do not actually have access to DFSORT any more, only Syncsort. May I ask you to please verify for me that if we were using DFSORT that the control cards below would do what we wish? If so then I can go to our Systems Programmers to open a ticket with Syncsort for assistance in verifying the operation of NULLOFL=RC4 in their product. When I use these control cards with Syncsort, the output file is null (has no records) but Syncsort is not setting RC=4, so I will go to them for support if the control cards I am using should give RC=4. OPTION COPY * ADD SEQNUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) OUTFIL NULLOFL=RC4, INCLUDE=(016,1,BI,EQ,X'FF',AND, (160,11,ZD,EQ,20,11,ZD)), BUILD=(1,4,5:5) Thank you for your generous and expert assistance on this forum. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 3:18 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Victor Gil, It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let me know -- -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Hi Sri, I am a colleague of Victor's, and the initial problem was not stated quite correctly. The input file is RECFM=VB, and the trailer record is identified by X'FF' in the first data position. The record count to be checked in the trailer record is at positions 145-155 (11 digits, ZD). The count in the trailer record does not include either the header record (X'00' in the first position) nor the trailer record, so the count in the trailer record should be the actual record count minus 2. The desired result is to check the trailer count versus the actual data record count and set RC=4 if they do not agree. Unfortunately we do not actually have access to DFSORT any more, only Syncsort. May I ask you to please verify for me that if we were using DFSORT that the control cards below would do what we wish? If so then I can go to our Systems Programmers to open a ticket with Syncsort for assistance in verifying the operation of NULLOFL=RC4 in their product. When I use these control cards with Syncsort, the output file is null (has no records) but Syncsort is not setting RC=4, so I will go to them for support if the control cards I am using should give RC=4. OPTION COPY * ADD SEQNUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), * USE SEQNUM-2 TO PUT COUNT OF DATA RECORDS IN POS 20 OF * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(020:5,11,ZD,SUB,+2,M11,LENGTH=11)) OUTFIL NULLOFL=RC4, INCLUDE=(016,1,BI,EQ,X'FF',AND, (160,11,ZD,EQ,20,11,ZD)), BUILD=(1,4,5:5) Thank you for your generous and expert assistance on this forum. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Sri h Kolusu Sent: Monday, June 27, 2016 3:18 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Verify record cound against the file trailer [by SORT?] Victor Gil, It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let me know -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Awesome, Kolusu, thanks a lot!!! --- It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
Victor Gil, It is quite simple to verify the number of records and validate it against the trailer record and if the record count match the return code is 0 and if the count is off then the return code is set to 4. I assumed that the trailer record is not counted as part of the record count. If it is indeed counted then simply remove the ",START=0" on the INREC statement. Use the following JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * A B C D RECS=5 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY INREC OVERLAY=(81:SEQNUM,5,ZD,START=0) OUTFIL NULLOFL=RC4, INCLUDE=(1,5,CH,EQ,C'RECS=',AND, (06,5,ZD,EQ,81,5,ZD)) //* The above job will end with RC=4 as there are only 4 records but the trailer says 5 records. Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation From: Victor Gil <victor@broadridge.com> To: IBM-MAIN@LISTSERV.UA.EDU Date: 06/27/2016 12:04 PM Subject: Verify record cound against the file trailer [by SORT?] Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> I am posting this for a co-worker - some of his flat files have trailing records stating the total record counter, e.g.: RECS=00567 The question is - what utility [I am guessing SORT should suffice] can he use to verify the trailer counter against the actual number of records in the file? Thanks in advance! -Victor- -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Verify record cound against the file trailer [by SORT?]
I've been using COUNT tso command (may be from CBTTAPE). It also count segments on an IMS unload file... ITschak ITschak Mugzach Z/OS, ISV Products and Application Security & Risk Assessments Professional On Mon, Jun 27, 2016 at 10:04 PM, Victor Gilwrote: > I am posting this for a co-worker - some of his flat files have trailing > records stating the total record counter, e.g.: > > RECS=00567 > > The question is - what utility [I am guessing SORT should suffice] can he > use to verify the trailer counter against the actual number of records in > the file? > > Thanks in advance! > -Victor- > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Verify record cound against the file trailer [by SORT?]
I am posting this for a co-worker - some of his flat files have trailing records stating the total record counter, e.g.: RECS=00567 The question is - what utility [I am guessing SORT should suffice] can he use to verify the trailer counter against the actual number of records in the file? Thanks in advance! -Victor- -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN