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

convert decimal(5,2) to char


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
smachohalla

New User


Joined: 25 Mar 2008
Posts: 6
Location: Chennai

PostPosted: Thu Apr 02, 2009 11:27 pm
Reply with quote

Posted: Thu Apr 02, 2009 11:26 pm Post subject: CONVERT DECIMAL(5,2) TO CHAR

--------------------------------------------------------------------------------

Hi..

Im unloading a DB2 table field which is declared DECIMAL(5,2) into a flat file. i just want it to be casted as CHAR.

For eg. if the table field value is "56.00" i want it be casted into the file as "00056.00".

Please let me know how to give the cast conversion in the unload query for this.

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 02, 2009 11:55 pm
Reply with quote

would be helpful to see what you are doing to dump the table.

if you are using sql parm - and have a select, normal db2 syntax for the cast will work.

keep in mind you need to end up with a fixed length otherwise the cast will gen a varchar and you will end up with a 'vli' in your dump dataset.

but, again, don't know what you are doing.
Back to top
View user's profile Send private message
smachohalla

New User


Joined: 25 Mar 2008
Posts: 6
Location: Chennai

PostPosted: Fri Apr 03, 2009 2:45 am
Reply with quote

Hi thanks for ur reply..

yes.. im using an sql parm to dump the table..

i just want to know how to cast decimal(5,2) as CHAR and also capturing the decimal point and the values after it.

please let me know if possible
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top