Formatting a numeric field to make it negative.
Formatting a numeric field to make it negative.
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?
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?
-
- Global Moderator
- Posts: 830
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Formatting a numeric field to make it negative.
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
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
Re: Formatting a numeric field to make it negative.
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.
- Robert Sample
- Global Moderator
- Posts: 1897
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Formatting a numeric field to make it negative.
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.
-
- Global Moderator
- Posts: 830
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Formatting a numeric field to make it negative.
You are not making a field negative You are just switching the sign...I can think of two options, one is to multiply the field by -1 or subtract it from 0.
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
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
Re: Formatting a numeric field to make it negative.
But are not both mean same?enrico-sorichetti wrote: ↑Thu Nov 09, 2017 9:02 pmYou are not making a field negative You are just switching the sign
Sorry for a late reply.
- Robert Sample
- Global Moderator
- Posts: 1897
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Formatting a numeric field to make it negative.
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.But are not both mean same?
Re: Formatting a numeric field to make it negative.
, never thought it that way. Thanks.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.
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