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

Sort options to convert Zone Decimal Postive to Negative


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Jul 11, 2006 9:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
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 Need to convert date format DFSORT/ICETOOL 20
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top