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
 

 

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 changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am
No new posts Problems in File-Aid / DB2 Spufi whil... amitc23 CLIST & REXX 6 Fri Feb 12, 2016 1:59 pm
No new posts Changing UID dynamically in ACF2 newroad CA Products 2 Sat Oct 31, 2015 1:17 am
No new posts IGZ0040S An invalid separate sign was... kishpra COBOL Programming 13 Sun Aug 02, 2015 2:41 am
No new posts How to modify the value using the sig... Vinay Pushpala PL/I & Assembler 3 Fri Feb 13, 2015 2:10 pm


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