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
 

 

Convert comp-2 to zoned decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Convert comp-2 to zoned decimal
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: 7936
Location: Bellevue, IA

PostPosted: Tue Jan 05, 2010 6:59 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jan 05, 2010 11:06 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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