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

DB2 unload - Need Help


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

New User


Joined: 24 Jul 2007
Posts: 55
Location: noida

PostPosted: Wed May 14, 2014 4:41 pm
Reply with quote

Hi,

I have a requirement to unload the Db2 table delimited by '~'. Any NULL data in a field should be represented as single '#' between 2 delimiters.

Additional,
A) Trailing spaces for CHAR fields should be removed during unload. ---> able to achieve using RTRIM in below card.

B) CHAR Fields (of Length 1 or Greater) with SPACES should come as a SINGLE SPACE between 2 Delimiters. ie. '~B~' B means single SPACE .
This should happen for all Char fields even if they are of length 1 byte or greater.


I am using the following Data card

UNLOAD DIRECT NO
SHRLEVEL CHANGE CONSISTENT NO QUIESCE NO
FORMAT CSV TERMINATEDBY '~' ENCLOSEDBY '' AND ''
NULLSTRING '#'
RTRIM

SELECT
*
FROM Tablename


Question : I am unable to find solution for point (B) ? Can you please help. Thanks.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri May 16, 2014 12:15 pm
Reply with quote

you should mention that you are using BMC Unload plus.
and I don't think you can do it during the unload.
You could go for a DFSORT with IN=C'~~',OUT=C'~ ~'
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Wed May 21, 2014 4:00 am
Reply with quote

IIf I understood correctly, instead of select * why don't you mentioned the all the column's and use a case and string to get what you want.
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 Load new table with Old unload - DB2 DB2 6
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts changing defaults in db2 admin - Unlo... DB2 0
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top