I think I figured this out...I had forgotten that Overlay works on the fields as you specify them, and I was overwriting my INREC fields before I used them. So I moved the Overlay fields around in a different order, and now get what I want.

Thank you and best regards,
Billy Ashton


------ Original Message ------
From "Billy Ashton" <[email protected]>
To "IBM Mainframe Discussion List" <[email protected]>
Date 10/6/2025 9:57:58 AM
Subject Re[2]: Generate nines-complement in DFSORT

Kolusu, it's good to hear from you again, and I hope that all's well.

I tried your change, and of course it works! Of course, if I put my whole requirement in, we might have done things differently, since I still have an issue. The key is whether I can pull information from my input file in addition to the overlay...you will probably get it from my failed attempt. Here is what I have:
//SORTIN   DD  *
GROUP #001      EACH LINE WILL CREATE A REPEAT GROUP
GROUP #002      EACH LINE WILL CREATE A REPEAT GROUP
GROUP #003      EACH LINE WILL CREATE A REPEAT GROUP
//SYSIN    DD  *
  OPTION COPY
  INREC BUILD=(DATE5,30:1,13)
  OUTFIL REPEAT=CNT,
  BUILD=(001:52X,                               $
         053:SEQNUM,9,ZD,START=1,INCR=1,        $ Record #
         062:30,10,C' Text:',JP3,               $ INPUT Text
         085:12,15,UFF,
         146:C'>'),                             $ LRECL=146
  OVERLAY=(SEQNUM,9,ZD,START=1,INCR=4,
         001🙁(1,9,ZD,ADD,-999999999),MUL,-1),M25,LENGTH=9)
/*

I want to be able to control my CNT Count iterations at a higher level, so that in this case, I will create CNT records 3 times. I also want to grab the timestamp (pos 12:15 from INREC), and pos 1:13 from that SORTIN rec (which is now pos 30:13 in the INREC) in addition to doing the overlay. What have I done wrong here?

Thank you and best regards,
Billy Ashton


------ Original Message ------
From "Sri Hari Kolusu" <[email protected]>
To [email protected]
Date 10/3/2025 10:10:17 PM
Subject Re: Generate nines-complement in DFSORT

 So, this will not work with SEQNUM:
BUILD=(001🙁((SEQNUM,9,ZD,START=K1,INCR=I1),

Billy Ashton,

You are using BUILD which cannot see the freshly built sequence number.  So 
switch to using OVERLAY as shown Alan benveniste and you can make multiple 
computations on the same field.

I am guessing that you are generating the 9-byte record file. If so, please use 
this untested control cards

//SYSIN    DD *
  OPTION COPY
  INREC BUILD=(9X)
  OUTFIL REPEAT=1000000,
         OVERLAY=(SEQNUM,9,ZD,START=1,INCR=4,
                 1🙁(1,9,ZD,ADD,-999999999),MUL,-1),M25,LENGTH=9)
/*


       S.Karthik Premnath : Just guessing,  If on the fly not possible, why not 
output the data into a temp file and make another pass where the seqnum can be 
treated as any normal integer ?

You don’t have to as DFSORT can do arithmetic calculations in the same pass of 
data

       S.Karthik Premnath : > Maybe you could try exploiting 
Hiperspace/Dataspace if possible. Not sure about underlying limitations.

I appreciate you trying to help, but DFSORT will only use HIPERSPACE/DATASPACES 
for SORTING the data.  Here OP is only COPYING/CREATING the data and DFSORT 
will not use them.

       Alain Benvéniste  Could you test this :

Thanks Alan.  I am sure that provided control cards will work.  Good to see you.

Thanks,
Kolusu



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

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

Reply via email to