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

Convert comp-2 to zoned decimal


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Satheeshkumar

New User


Joined: 20 Feb 2009
Posts: 51
Location: Chennai

PostPosted: Tue Jan 05, 2010 6:46 pm
Reply with quote

Hi,

My requirement is that My input file contains the COMP-2 field. Is it possible to convert the COMP-2 to ZONED decimal?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 05, 2010 6:59 pm
Reply with quote

Maybe. If the value in the COMP-2 field is over 10 to the 30th power, then 31 digits is not enough to hold the value and therefore the move cannot be done. But as long as the COMP-2 field value is appropriate for the zoned decimal value, a simple MOVE should do the trick.
Back to top
View user's profile Send private message
Satheeshkumar

New User


Joined: 20 Feb 2009
Posts: 51
Location: Chennai

PostPosted: Tue Jan 05, 2010 7:07 pm
Reply with quote

Can any one provide the sample code using SORT
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 Jan 05, 2010 11:06 pm
Reply with quote

COMP-2 is an 8-byte FL value. You can convert it to a ZD integer (but the decimal part will be lost) using:

Code:

  INREC BUILD=(...,p,8,FL,TO=ZD,...)


where p is the starting position of the COMP-2 field.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Convert CSV to flat file. DFSORT/ICETOOL 6
No new posts convert arbitrary UTC to local (SYD) ... COBOL Programming 1
No new posts Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Unable to interpret a hex value to De... COBOL Programming 7
Search our Forums:


Back to Top