Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Expand a field while unloading a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Pradip kumar Mohanty

New User


Joined: 16 Sep 2007
Posts: 33
Location: India

PostPosted: Sun Aug 24, 2008 4:40 am    Post subject: Expand a field while unloading a table
Reply with quote

Hi,

Is there any built-in function available to expand a field on the fly while unloading.

Essentially what I need is :
Table-A in Database-A, has one of its filed defined as CUST_AMT DECIMAL(5, 0) NOT NULL.
The same Table-A in Database-B has the same filed defined as CUST_AMT DECIMAL(9, 4) NOT NULL.

I need to load the Table-A in Database-B with Table-A-Database-A's data.

ex: CUST_AMT value in one of the records of Table-A is 12345 it shd be expanded/reformated to 12345.0000 to the unload dataset so that it can fit into the corresponding filed in Table-B.

I wish any DB2 function that I can use with the unload query to accompolish this.


Any help?

Best Regards
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Aug 24, 2008 7:52 am    Post subject:
Reply with quote

Have you tried CAST?
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Mon Aug 25, 2008 4:27 am    Post subject:
Reply with quote

Hi,

There could be DB2 solutions available. But what I can think of is as follows:
1) Unload Database A table.
2) Convert Decimal(5,0) field to Decimal(9,4) (you can use DFSORT utility to achieve this, by writing a control card like TO=PD,LENGTH=7). Your output dataset will have a record length 4 more than the input one.
3) Use the output of Step2 to load Database B table.
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
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

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