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 decimal(5,2) to char

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: convert decimal(5,2) to char
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: 6967
Location: porcelain throne

PostPosted: Thu Apr 02, 2009 11:55 pm    Post subject:
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    Post subject: Reply to: convert decimal(5,2) to char
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
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


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