View previous topic :: View next topic
|
Author |
Message |
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
|