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

Convert a packed decimal value to zoned decimal while unload


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

New User


Joined: 29 Nov 2019
Posts: 5
Location: India

PostPosted: Mon Mar 16, 2020 6:02 pm
Reply with quote

Hi,
I am trying to unload a db2 column value using DSNTIAUL utility which is Packed decimal format . I want the output to be in the zoned decimal format.

I tried using zoned (column _name) which threw an error.

Can you please help me with the function which could be used to achieve the requirement

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

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Mon Mar 16, 2020 9:41 pm
Reply with quote

Dinesh Mani wrote:
I want the output to be in the zoned decimal format.

I tried using zoned (column _name) which threw an error.


1) There is no such function, or whatever, named ZONED, neither in DB2, nor in 100+ other tools/languages/environments I ever dealt with.

2) In order to convert decimal to character/printable format, there is function CHAR supported in DB2, and many other places.

3) What exactly is the need to convert to Zoned Decimal? Are you sure? Do you know exactly what the Zoned Decimal format is, and how to use it?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Mar 17, 2020 4:08 am
Reply with quote

Look for CAST or VARCHAR_FORMAT
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Mar 17, 2020 6:11 am
Reply with quote

I use DIGITS()
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Mar 17, 2020 7:34 am
Reply with quote

Neither sign nor decimal point appear in the result when DIGITS is used.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Thu Mar 19, 2020 4:11 am
Reply with quote

Rohit Umarjikar wrote:
Neither sign nor decimal point appear in the result when DIGITS is used.
For me that is a feature rather than a problem. For pretty output I use QMF.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Mar 19, 2020 5:57 am
Reply with quote

don.leahy wrote:
Rohit Umarjikar wrote:
Neither sign nor decimal point appear in the result when DIGITS is used.
For me that is a feature rather than a problem. For pretty output I use QMF.
absolutely but that is not the solution in this context. Thanks
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 Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts CONVERT a given date from UTC TO BST CICS 0
No new posts how to eliminate null indicator value... DB2 7
Search our Forums:

Back to Top