Increment a number by 11 only !



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Increment a number by 11 only !

Postby ranga_subham » Fri Oct 16, 2015 9:30 am

Need help on the below requirement -

I have a 12 digit number in that last 5 digits has to be incremented by +11. This needs to happen 10,000 times. Is there a way to do it using sort.
I am giving a example below -

12345678911 == example for first number based on this it should increment by 11 and generate 10, 000 numbers.
12345678922 == next number incremented by 11 (11 + 11 = 22)
12345678933 == next number incremented by 11 (22 + 11 = 33)
----
----

Please help.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Increment a number by 11 only !

Postby BillyBoyo » Fri Oct 16, 2015 11:46 am

If there is only one record on your dataset, look at OUTFIL REPEAT= and SEQNUM on OVERLAY in your documentation.

If you have more than one record, please clarify your question.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Increment a number by 11 only !

Postby ranga_subham » Fri Oct 16, 2015 12:10 pm

Hi,

Nice Idea. Thanks.
Yes. Dataset has only one record (12345678911). how to use overlay in this situation please?

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Increment a number by 11 only !

Postby BillyBoyo » Fri Oct 16, 2015 1:10 pm

OK, the OVERLAY is quite easy. The next problem, though is that 10,000 times 11 gives a six-digit result, and you only want to change five digits. The answer to that impacts the detail of the OVERLAY.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Increment a number by 11 only !

Postby ranga_subham » Mon Oct 19, 2015 9:33 am

Hi,

Thanks again. I won't mind to limit it to 9999 times to avoid this risk factor.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Increment a number by 11 only !

Postby BillyBoyo » Mon Oct 19, 2015 11:37 am

10,000 * 11 = 110,0000
9,999 * 11 = 10,9989
9,090 * 11 = 99.990

Even taking 9,090, unless the current number starts with nnn00000 to nnn00009 it will overflow the five low-order digits.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post