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
 
changing the sign internally.

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

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Tue Jun 06, 2006 6:59 pm    Post subject: changing the sign internally.
Reply with quote

is there any sort utility options to convert Zoned Decimal (Positive Value) to Zoned Decimal (Negative Value).

For eg: Amount field is 21.69 then internally in mainframe it is stored as

Code:

Positive Value is stored as :
FFFFFFFFFFF
00000002169

Negative value is stored as :
FFFFFFFFFFD
00000002169


i need the Sort utility function to convert the X'F' to X'D' ( Last half byte), hence the Zoned decimal amount field will be converted to Negative amount.
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: Tue Jun 06, 2006 9:47 pm    Post subject:
Reply with quote

You can do that with DFSORT by multiplying by -1.

Let's assume you have an 11-byte ZD field starting in position 21.

If you only have positive ZD values, you can use:

Code:

  OPTION COPY
  INREC OVERLAY=(21:21,11,ZD,MUL,-1,TO=ZD,LENGTH=11)


If you have both positive and negative ZD values and you only want to change the positive values to negative values, you can use:

Code:

  INREC IFTHEN=(WHEN=(21,11,ZD,GE,+0),
        OVERLAY=(21:21,11,ZD,MUL,-1,TO=ZD,LENGTH=11))
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 Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am

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