Formatting a numeric field to make it negative.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
utkarsh
Registered Member
Posts: 64
Joined: Fri Jun 21, 2013 10:32 pm

Formatting a numeric field to make it negative.

Post by utkarsh »

Hi,

For a test SORT job I need to format a numeric field to make it negative. For that, I can think of two options, one is to multiply yhr fied with "-1" or subtractit from 0. In both the case which one is more efficeint and why, please let me know.

If I have to test such scenario my own what can I do to get a fair estimate on this?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 821
Joined: Wed Sep 11, 2013 3:57 pm

Re: Formatting a numeric field to make it negative.

Post by enrico-sorichetti »

how many billions of records do You have to process that would make any difference ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
utkarsh
Registered Member
Posts: 64
Joined: Fri Jun 21, 2013 10:32 pm

Re: Formatting a numeric field to make it negative.

Post by utkarsh »

Not billions of records are there but I shall have considerable amount of records, at least in millions. This job would be a daily job.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1878
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Formatting a numeric field to make it negative.

Post by Robert Sample »

Even if you are processing 10 million records per day, that is only 3.65 billion per year. With the cycle time of the system Z machines, you might (and I stress MIGHT) make a few CPU seconds difference over the course of the entire year. You have already spent more time worrying about this than you could possibly save in several years or more.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 821
Joined: Wed Sep 11, 2013 3:57 pm

Re: Formatting a numeric field to make it negative.

Post by enrico-sorichetti »

...I can think of two options, one is to multiply the field by -1 or subtract it from 0.
You are not making a field negative You are just switching the sign :?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
utkarsh
Registered Member
Posts: 64
Joined: Fri Jun 21, 2013 10:32 pm

Re: Formatting a numeric field to make it negative.

Post by utkarsh »

enrico-sorichetti wrote: Thu Nov 09, 2017 9:02 pmYou are not making a field negative You are just switching the sign
But are not both mean same?

Sorry for a late reply.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1878
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Formatting a numeric field to make it negative.

Post by Robert Sample »

But are not both mean same?
Not at all -- if the value is +10 and you multiply by -1 you have a -10; if the value is -10 and you multiply by -1 you have a +10. This is switching the sign. Making the field negative would be testing the value and if it is positive then multiply by -1; if the value is negative then don't do anything to it.
utkarsh
Registered Member
Posts: 64
Joined: Fri Jun 21, 2013 10:32 pm

Re: Formatting a numeric field to make it negative.

Post by utkarsh »

Robert Sample wrote: Tue Feb 27, 2018 6:32 pmNot at all -- if the value is +10 and you multiply by -1 you have a -10; if the value is -10 and you multiply by -1 you have a +10. This is switching the sign. Making the field negative would be testing the value and if it is positive then multiply by -1; if the value is negative then don't do anything to it.
:shock:, never thought it that way. Thanks.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”