IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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

Active Member


Joined: 29 Apr 2008
Posts: 878
Location: Maryland

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: 2508
Location: NY,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: 692
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: 2508
Location: NY,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: 692
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: 2508
Location: NY,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 All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COnvert a column with mix of hex ,cha... DB2 5
No new posts Unload Report in ARCHIVE from CA-Disp... CA Products 0
No new posts To convert numeric to Packed Decimal DFSORT/ICETOOL 9
No new posts how to convert Hex String t char hex PL/I & Assembler 6
This topic is locked: you cannot edit posts or make replies. DFSORT-How to convert ZD to ZS in DFSORT DFSORT/ICETOOL 2

Back to Top