Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT CARD To Change The Sign Of Signed Variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Rajen

New User


Joined: 05 May 2005
Posts: 61

PostPosted: Fri Dec 15, 2006 9:11 pm    Post subject: SORT CARD To Change The Sign Of Signed Variable
Reply with quote

Hi,
I need to reverse the sign of a variable having picture clause as
PIC S9(6) and PIC S9(5).

For example, if the input values are as below.
-15
126
32
81

the output should be
15
-126
- 32
- 81

I guess we need to subtract this values from zero (0 - Variable) or else we need to multiple the variable with -1.

The varialbe starts at position 30 and is of length 6 bytes.

Please let me know if it is not clear.
Back to top
View user's profile Send private message

demora

New User


Joined: 12 Dec 2006
Posts: 4
Location: Cleveland, OH

PostPosted: Sat Dec 16, 2006 1:44 am    Post subject:
Reply with quote

You can also multiply variable*-1 to get the reverse sign.

Not sure how to do it in SORT or if you can....What does the file look like with the sign?

If it's '-000015' in the file and ' 000085' then you could do an OUTREC in sort to change them.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Dec 16, 2006 3:15 am    Post subject:
Reply with quote

YOu can use DFSORT control statements like this to multiply the value by -1:

Code:

  OPTION COPY                                   
  INREC OVERLAY=(30:30,6,PD,MUL,-1,TO=PD,LENGTH=6) 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us