Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
boopathy.gopalsamy

New User

Joined: 29 May 2006
Posts: 2
Location: India

 Posted: Tue Jul 11, 2006 5:30 pm    Post subject: Sort options to convert Zone Decimal Postive to Negative Hi all, Please let us know if any body aware the sort utility options to convert Zone Decimal (Positive Value) to Zoned Decimal (Negative Value). For eg: Amount field is 21.69 then internally in mainframe it is stored as Positive Value is stored as : FFFFFFFFFFF 00000002169 Negative value is stored as : FFFFFFFFFFD 00000002169 We 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.

Frank Yaeger

DFSORT Moderator

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

Posted: Tue Jul 11, 2006 9:16 pm    Post subject:

Here's a DFSORT job that will change a positive value (C or F sign) to a negative value (D sign), but leave a negative value (D sign) as is. I assumed your 11-byte ZD value started in position 21 but you can change the job appropriately for other starting positions.

 Code: //S1    EXEC  PGM=ICEMAN //SYSOUT    DD  SYSOUT=* //SORTIN DD DSN=...  input file //SORTOUT DD DSN=...  output file //SYSIN    DD    *    OPTION COPY * If ZD value >= 0, change sign to minus (D).    INREC IFTHEN=(WHEN=(21,11,ZD,GE,+0),       OVERLAY=(21:21,11,ZD,MUL,-1,TO=ZD,LENGTH=11)) /*
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us