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 options to convert Zone Decimal Postive to Negative

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
boopathy.gopalsamy

New User


Joined: 29 May 2006
Posts: 2
Location: India

PostPosted: Tue Jul 11, 2006 5:30 pm    Post subject: Sort options to convert Zone Decimal Postive to Negative
Reply with quote

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.
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 Jul 11, 2006 9:16 pm    Post subject:
Reply with quote

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))
/*
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 4 Sat Aug 19, 2017 2:33 pm
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm


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