Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert a packed decimal value to zoned decimal while unload

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Convert a packed decimal value to zoned decimal while unload
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: 860
Location: Maryland

PostPosted: Mon Mar 16, 2020 9:41 pm    Post subject: Re: Convert a packed decimal value to zoned decimal while unload
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: 2487
Location: NY,USA

PostPosted: Tue Mar 17, 2020 4:08 am    Post subject:
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    Post subject:
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: 2487
Location: NY,USA

PostPosted: Tue Mar 17, 2020 7:34 am    Post subject:
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    Post subject:
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: 2487
Location: NY,USA

PostPosted: Thu Mar 19, 2020 5:57 am    Post subject:
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    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 a column with mix of hex ,cha... shub2204 DB2 5 Fri Oct 02, 2020 2:20 pm
No new posts Unload Report in ARCHIVE from CA-Disp... vpuerto CA Products 0 Sat Aug 29, 2020 7:31 am
No new posts To convert numeric to Packed Decimal vinu78 DFSORT/ICETOOL 9 Fri Jul 31, 2020 7:14 pm
No new posts how to convert Hex String t char hex Martylin PL/I & Assembler 6 Fri Jun 05, 2020 7:45 pm
This topic is locked: you cannot edit posts or make replies. DFSORT-How to convert ZD to ZS in DFSORT useit DFSORT/ICETOOL 2 Thu Mar 26, 2020 10:43 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us