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: 8697
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top