Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us