After further testing, it looks like I can do all sort of arithmetic on other numeric fields, but can't seem to do anything on the SEQNUM field on the fly.

So, this will not work with SEQNUM:
BUILD=(001:(((SEQNUM,9,ZD,START=K1,INCR=I1),
           ADD,-999999999),MUL,-1), . . .

But it will work on other numeric fields like a single record with a date field on the input.

Any ideas?

Thank you and best regards,
Billy Ashton


------ Original Message ------
From "Billy Ashton" <[email protected]>
To "IBM Mainframe Discussion List" <[email protected]>
Date 10/3/2025 12:16:13 PM
Subject Generate nines-complement in DFSORT

Hi all! I have a DFSORT that is generating a test file for me, and I currently pass in a starting numeric value and increment value to generate my first 9-byte field. This has been working fine and has been useful for lots of things.

Now, though I want to take that first field, and make it a 9-s complement instead of the SEQNUM value. Can anyone tell me if there is a way to translate from 0123456789 to 9876543210, or to subtract the SEQNUM from 999999999? DFSORT does not allow incrementing by negative value for SEQNUM.

Here is the relevant part of the SYSIN:
OPTION COPY
OUTFIL REPEAT=CNT,
BUILD=(001:SEQNUM,9,ZD,START=K1,INCR=I1,
. . .

So if I start with K1 = 100000001, and with I1 = 4, my first few records start:
100000001...
100000005...
100000009...

and I want them to be
899999998...
899999994...
899999991...

Thank you and best regards,
Billy Ashton


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

Reply via email to