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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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