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

To unload decimal field in readable format


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

New User


Joined: 09 Jun 2008
Posts: 6
Location: India

PostPosted: Wed Nov 12, 2014 4:45 pm
Reply with quote

Hi All,

My requirement to unload a table data in readable format. I have handles few datatypes. Problem with Decimal fields.

I tried with DIGITS. It is showing in readable but without decimal point.

If the value is 123.45, same should be populated while unloading.

Utility used : INZUTILB
Tried with DECIMAL EXTERNAL keyword -> Seems not supported.

Appreciate your help !
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Nov 12, 2014 8:33 pm
Reply with quote

Hello and Welcome to the Forum.
You can try to select the column as CHAR(MY_COLUMN) or LPAD(MY_COLUMN,15)
(NB. LPAD returns a varchar)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Nov 12, 2014 11:13 pm
Reply with quote

Run DSNTEP2 which automatically expand all the columns to readable format. But the only problem with this is the LRECL is limited to 133 bytes. so the output will will span multiple lines
Back to top
View user's profile Send private message
p.anbuselvan

New User


Joined: 09 Jun 2008
Posts: 6
Location: India

PostPosted: Thu Nov 13, 2014 12:23 pm
Reply with quote

Thanks Marso.

CHAR(MY_COLUMN) works for me. icon_biggrin.gif
Back to top
View user's profile Send private message
p.anbuselvan

New User


Joined: 09 Jun 2008
Posts: 6
Location: India

PostPosted: Thu Nov 13, 2014 1:57 pm
Reply with quote

When I am using CHAR(MY_COLUMN), seems first byte is reserved for sign.

When the value is negative, it shows '-' whereas spaces for positive value.

Is there any way to get '+' populated for positive values?
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top