IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT CARD To Change The Sign Of Signed Variable


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Sat Dec 16, 2006 3:15 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top