>>>I never imagined it would be so complex, but I will try to figure it 
out.

Bill,

To begin you have about 16 individual records for each group and you 
wanted bits and pieces from each and then merge them into a single line. 
You also had 3 different customer contact data which needs to be handled 
as all of them start at the same position. 

The INREC is used to parse the data and pick the required fields
The OUTREC is used to merge the required fields into a single record using 
WHEN=GROUP
The OUTFIL is used to write out the single record from a group of 16 
records.

I noticed that I missed a comma for the 2 contact fields as I only pushed 
26 bytes instead of 27.  So please change the last 4 IFTHEN statements and 
the corresponding IFTHEN=(WHEN=GROUP statements

 
        IFTHEN=(WHEN=(530,1,ZD,EQ,1), 
       OVERLAY=(358:278,53, 
                278:53X),HIT=NEXT), 
 
        IFTHEN=(WHEN=(530,1,ZD,EQ,2), 
       OVERLAY=(438:278,53, 
                278:53X),HIT=NEXT), 
 
        IFTHEN=(WHEN=(545,1,ZD,EQ,1), 
       OVERLAY=(411:331,27, 
                331:27X)), 
 
        IFTHEN=(WHEN=(545,1,ZD,EQ,2), 
       OVERLAY=(491:331,26, 
                331:27X)) 

         IFTHEN=(WHEN=GROUP,BEGIN=(331,1,CH,EQ,C'"'), 
                 PUSH=(331:331,27)), 
         IFTHEN=(WHEN=GROUP,BEGIN=(358,1,CH,EQ,C'"'), 
                 PUSH=(358:358,53)), 
         IFTHEN=(WHEN=GROUP,BEGIN=(411,1,CH,EQ,C'"'), 
                 PUSH=(411:411,27)), 
         IFTHEN=(WHEN=GROUP,BEGIN=(438,1,CH,EQ,C'"'), 
                 PUSH=(438:438,53)), 
         IFTHEN=(WHEN=GROUP,BEGIN=(491,1,CH,EQ,C'"'), 
                 PUSH=(491:491,26)), 


Thanks,
Kolusu



From:   Bill Ashton <[email protected]>
To:     [email protected]
Date:   12/29/2017 02:13 PM
Subject:        Re: Problem creating file of combined records with SORT
Sent by:        IBM Mainframe Discussion List <[email protected]>



Thanks, Kolusu; I will be leaving shortly, too, and will give this a try 
in
the next week or so. I never imagined it would be so complex, but I will
try to figure it out.

Happy new year!
Billy






----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to