Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
With Frank Yaeger's help I was able to resolve this problem compatibly for both DFSORT and SYNCSORT. For the archives, the sanitized solution is copied below. When SYNCSORT supports the IFTRAIL enhancement introduced by DFSORT PTF UK90026 that will provide a much simpler solution. Thanks once again to Frank for his excellent help. Peter Sanitized solution for JOIN with trailer count adjustment to multiple OUTFIL outputs: OPTION VLSCMP,VLSHRT * SPECIFY JOIN RECORD RETENTION JOIN UNPAIRED,F2 * SPECIFY THE JOIN KEYS FOR FILE 1 AND 2 JOINKEYS FILE=F1,FIELDS=(21,3,A,83,25,A) JOINKEYS FILE=F2,FIELDS=(21,3,A,83,25,A) * SPECIFY REFORMAT FOR FILE 1 AND 2, COPY 'J' OF 'REJ' TO BYTE 1 OF REC REFORMAT FIELDS=(F2:1,4,F1:110,1,F2:6) * * NOW WE SPECIFY HOW TO PROCESS THE JOINED + UNPAIRED RECORDS * SORT FIELDS=COPY * * THIS SELECTS ONLY MATCHED DATA RECORDS * AND HEADER/TRAILER RECORDS * OUTPUT RECORD BUILD CHANGES THE 'J' BACK TO 'D' * OUTFIL FNAMES=OUT1,INCLUDE=((05,2,CH,EQ,C'J1'),OR, (05,2,CH,EQ,X''),OR, (05,2,CH,EQ,X'')), IFTHEN=(WHEN=INIT, BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), IFTHEN=(WHEN=(16,2,CH,EQ,C'J1'), BUILD=(1,4,C'D',6:17)), IFTHEN=(WHEN=(16,2,CH,EQ,X''), BUILD=(1,4,5:16)), IFTHEN=(WHEN=(16,2,CH,EQ,X''), BUILD=(1,4,5:16,144, 149:5,11,ZD,SUB,+2,M11,LENGTH=11, 160:171)) * * THIS SELECTS ONLY UNMATCHED DATA RECORDS * WHERE THE SELECTION KEY = '000' * AND HEADER/TRAILER RECORDS * OUTFIL FNAMES=OUT2,INCLUDE=(((05,2,CH,EQ,C' 1'),AND, (15,3,CH,EQ,C'000')),OR, (05,2,CH,EQ,X''),OR, (05,2,CH,EQ,X'')), IFTHEN=(WHEN=INIT, BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), IFTHEN=(WHEN=(16,2,CH,EQ,C' 1'), BUILD=(1,4,C'D',6:17)), IFTHEN=(WHEN=(16,2,CH,EQ,X''), BUILD=(1,4,5:16)), IFTHEN=(WHEN=(16,2,CH,EQ,X''), BUILD=(1,4,5:16,144, 149:5,11,ZD,SUB,+2,M11,LENGTH=11, 160:171)) -- 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...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html
DFSORT JOINKEYS question: Where to put INREC and OUTREC?
I have developed a JOINKEYS application, but I need to do one more function as part of the process, if it is possible. I am joining two VB files on 2 keys in the fixed part of the VB records and using OUTFIL statements to split the result into multiple output files. In each of the output files there is a header record (key values = all X'00') and a trailer record (key values = all X'FF'). I also want to insert a true record count into each trailer record in each output file, i.e. a record count that excludes the header and trailer records in a particular output file. Frank Yaeger already helped me in a prior email to construct a way to produce this count for a single-file COPY operation using an INREC and an OUTREC, which would require a separate pass over each output file. This is that function: 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 * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(160:5,11,ZD,SUB,+2,M11,LENGTH=11)) * REMOVE SEQNUM. OUTREC BUILD=(1,4,5:16) Below is a sanitized version of my JOINKEYS application with just two of the OUTFIL statements as an example. My question is, where do I place the INREC above to accomplish the insertion of the SEQNUM fields for each record in each OUTFIL such that each OUTFIL has the correct record count in the trailer record? If I could do that, I could adjust the BUILD parameters in the OUTFIL statements to remove the SEQNUM inserted by the INREC. I did try just adding the INREC/OUTREC following the SORT statement, but that results in a trailer count for the entire JOINed file, not individually for each OUTFIL file. Can this be done in one pass? Or do I need a separate trailer count pass for each output file? TIA for any assistance you can provide. Peter Sanitized JOINKEYS application: OPTION VLSCMP,VLSHRT * SPECIFY JOIN RECORD RETENTION JOIN UNPAIRED,F2 * SPECIFY THE JOIN KEYS FOR FILE 1 AND 2 JOINKEYS FILE=F1,FIELDS=(21,3,A,83,25,A) JOINKEYS FILE=F2,FIELDS=(21,3,A,83,25,A) * SPECIFY REFORMAT FOR FILE 1 AND 2 * POSITIONS 1-2 OF ALL INPUT DATA RECORDS (VB POS 5-6) ALWAYS CONTAIN 'D1' * POSITION 106 (VB POS 110) OF F1 DATA RECORDS ALWAYS CONTAINS 'J' * POSNS 1-2 AND 106 (VB POS 506 AND 110) OF HEADER RECORDS CONTAIN X'00' * POSNS 1-2 AND 106 (VB POS 506 AND 110) OF TRAILER RECORDS CONTAIN X'FF' REFORMAT FIELDS=(F2:1,4,F1:110,1,F2:6) SORT FIELDS=COPY * THIS SELECTS ONLY MATCHED RECORDS * AND HEADER/TRAILER RECORDS * OUTPUT RECORD BUILD CHANGES THE 'J' BACK TO 'D' OUTFIL FNAMES=OUT1,INCLUDE=((5,2,CH,EQ,C'J1'),OR, (5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), IFTHEN=(WHEN=(5,2,CH,EQ,C'J1'), BUILD=(1,4,C'D',6:6)), IFTHEN=(WHEN=((5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), BUILD=(1,4,5:5)) * THIS SELECTS ONLY UNMATCHED RECORDS OF ONE TYPE * AND HEADER/TRAILER RECORDS * OUTPUT RECORD BUILD CHANGES THE ' ' BACK TO 'D' OUTFIL FNAMES=OUT2,INCLUDE=(((05,2,CH,EQ,C' 1'),AND, (15,4,CH,EQ,C'0700')),OR, (5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), IFTHEN=(WHEN=(5,2,CH,EQ,C' 1'), BUILD=(1,4,C'D',6:6)), IFTHEN=(WHEN=((5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), BUILD=(1,4,5:5)) -- 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
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
Peter, I'm not sure exactly what you're trying to do, but I can think of two ways to get a count like that. One would be to use an IFTHEN WHEN=INIT clause in each OUTFIL before the other IFTHEN clauses to insert the sequence number (of course, you have to adjust the positions in the subsequent IFTHEN clauses). The other would be to use COUNT-2=(edit) in TRAILER1 for each OUTFIL. If you want more help with this, feel free to send me more details offline (yae...@us.ibm.com): Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the rules for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration = DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort Peter Farley on IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu wrote on 09/15/2011 11:09:13 AM: From: Farley, Peter x23353 peter.far...@broadridge.com To: IBM-MAIN@bama.ua.edu Date: 09/15/2011 11:10 AM Subject: DFSORT JOINKEYS question: Where to put INREC and OUTREC? Sent by: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu I have developed a JOINKEYS application, but I need to do one more function as part of the process, if it is possible. I am joining two VB files on 2 keys in the fixed part of the VB records and using OUTFIL statements to split the result into multiple output files. In each of the output files there is a header record (key values = all X'00') and a trailer record (key values = all X'FF'). I also want to insert a true record count into each trailer record in each output file, i.e. a record count that excludes the header and trailer records in a particular output file. Frank Yaeger already helped me in a prior email to construct a way to produce this count for a single-file COPY operation using an INREC and an OUTREC, which would require a separate pass over each output file. This is that function: 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 * LAST RECORD (IDENTIFIED BY X'FF'). IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), OVERLAY=(160:5,11,ZD,SUB,+2,M11,LENGTH=11)) * REMOVE SEQNUM. OUTREC BUILD=(1,4,5:16) Below is a sanitized version of my JOINKEYS application with just two of the OUTFIL statements as an example. My question is, where do I place the INREC above to accomplish the insertion of the SEQNUM fields for each record in each OUTFIL such that each OUTFIL has the correct record count in the trailer record? If I could do that, I could adjust the BUILD parameters in the OUTFIL statements to remove the SEQNUM inserted by the INREC. I did try just adding the INREC/OUTREC following the SORT statement, but that results in a trailer count for the entire JOINed file, not individually for each OUTFIL file. Can this be done in one pass? Or do I need a separate trailer count pass for each output file? Sanitized JOINKEYS application: OPTION VLSCMP,VLSHRT * SPECIFY JOIN RECORD RETENTION JOIN UNPAIRED,F2 * SPECIFY THE JOIN KEYS FOR FILE 1 AND 2 JOINKEYS FILE=F1,FIELDS=(21,3,A,83,25,A) JOINKEYS FILE=F2,FIELDS=(21,3,A,83,25,A) * SPECIFY REFORMAT FOR FILE 1 AND 2 * POSITIONS 1-2 OF ALL INPUT DATA RECORDS (VB POS 5-6) ALWAYS CONTAIN 'D1' * POSITION 106 (VB POS 110) OF F1 DATA RECORDS ALWAYS CONTAINS 'J' * POSNS 1-2 AND 106 (VB POS 506 AND 110) OF HEADER RECORDS CONTAIN X'00' * POSNS 1-2 AND 106 (VB POS 506 AND 110) OF TRAILER RECORDS CONTAIN X'FF' REFORMAT FIELDS=(F2:1,4,F1:110,1,F2:6) SORT FIELDS=COPY * THIS SELECTS ONLY MATCHED RECORDS * AND HEADER/TRAILER RECORDS * OUTPUT RECORD BUILD CHANGES THE 'J' BACK TO 'D' OUTFIL FNAMES=OUT1,INCLUDE=((5,2,CH,EQ,C'J1'),OR, (5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), IFTHEN=(WHEN=(5,2,CH,EQ,C'J1'), BUILD=(1,4,C'D',6:6)), IFTHEN=(WHEN=((5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), BUILD=(1,4,5:5)) * THIS SELECTS ONLY UNMATCHED RECORDS OF ONE TYPE * AND HEADER/TRAILER RECORDS * OUTPUT RECORD BUILD CHANGES THE ' ' BACK TO 'D' OUTFIL FNAMES=OUT2,INCLUDE=(((05,2,CH,EQ,C' 1'),AND, (15,4,CH,EQ,C'0700')),OR, (5,2,CH,EQ,X''),OR, (5,2,CH,EQ,X'')), IFTHEN=(WHEN=(5,2,CH,EQ,C' 1'), BUILD=(1,4,C'D',6:6)), IFTHEN=(WHEN=((5,2,CH
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
Peter, Looking at your note again. I suspect that DFSORT's relatively new IFTRAIL function of OUTFIL can help you do what you want more easily (I suspect it wasn't yet available when I showed you the SEQNUM trick). For complete details on DFSORT's IFTRAIL, see: http://www.ibm.com/support/docview.wss?rs=114uid=isg3T7000242 Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration = DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
Hi Frank, Replying in reverse order to your helpful replies. Unfortunately I am using one of your competitors' products (Syncsort) and they don't have IFTRAIL yet, though I suppose they will at some point. I will reply at more length to your other message shortly. Thanks again for helping. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Frank Yaeger Sent: Thursday, September 15, 2011 3:16 PM To: IBM-MAIN@bama.ua.edu Subject: Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC? Peter, Looking at your note again. I suspect that DFSORT's relatively new IFTRAIL function of OUTFIL can help you do what you want more easily (I suspect it wasn't yet available when I showed you the SEQNUM trick). For complete details on DFSORT's IFTRAIL, see: http://www.ibm.com/support/docview.wss?rs=114uid=isg3T7000242 Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration -- 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...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
On Thu, 15 Sep 2011 16:24:43 -0400, Farley, Peter x23353 peter.far...@broadridge.com wrote: Unfortunately I am using one of your competitors' products (Syncsort) and they don't have IFTRAIL yet, though I suppose they will at some point. Speaking entirely personally, and not as a representative of IBM, I'd like to suggest that as you're asking a Syncsort question it was rather misleading for you to have put DFSORT in your subject line. -- Walt -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
Well, I do also have DFSORT available, but for this application I won't know a priori which product will be used (it may run in different locations on different sysplexes) so I need to keep it compatible. I am testing with both SORT versions. Sorry if I did not make that clear. Peter -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Walt Farrell Sent: Thursday, September 15, 2011 4:51 PM To: IBM-MAIN@bama.ua.edu Subject: Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC? On Thu, 15 Sep 2011 16:24:43 -0400, Farley, Peter x23353 peter.far...@broadridge.com wrote: Unfortunately I am using one of your competitors' products (Syncsort) and they don't have IFTRAIL yet, though I suppose they will at some point. Speaking entirely personally, and not as a representative of IBM, I'd like to suggest that as you're asking a Syncsort question it was rather misleading for you to have put DFSORT in your subject line. -- 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...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html
Re: DFSORT JOINKEYS question: Where to put INREC and OUTREC?
On Thu, 15 Sep 2011 17:12:57 -0400, Farley, Peter x23353 peter.far...@broadridge.com wrote: Well, I do also have DFSORT available, but for this application I won't know a priori which product will be used (it may run in different locations on different sysplexes) so I need to keep it compatible. I am testing with both SORT versions. Sorry if I did not make that clear. No, that wasn't clear. Thanks for the clarification. -- Walt -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html