Trouble with unloading ASCII data

Glen Sanderson

Trouble with unloading ASCII data
I was trying to unload data from an ASCII DB2 table using the following syntax:
UNLOAD
TABLESPACE XXDBNAME.XXTSNAME
FROMCOPYDDN SYSBKUP
ASCII
FROM TABLE OWNER.XXTABLE
HEADER NONE
  WHEN (HEAD_NAME='RW330-DR-USA')

Several other conbinations of the WHEN clause such as LIKE 'RW330%' and
HEAD_NAME >= 'RW330       ' AND HEAD_NAME <='RW330ZZZZZZZ' did not work either.
The only method that did work was using the HEX equivalent:
WHEN (HEAD_NAME = X'52573333302D44522D555341' )

Is there any other method to unload data without having to "translate" the WHEN
clause into HEX?
 


"MMS <safeway.com>" made the following annotations.
------------------------------------------------------------------------------
Warning:
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately.

======

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Michael Ebert

Re: Trouble with unloading ASCII data
(in response to Glen Sanderson)
Actually you're not translating into Hex but into ASCII. The Utility WHEN
clause does not convert character strings into ASCII when used on ASCII
tables from an EBCDIC system. This is unlike an SQL SELECT - which has
caused me a lot of swearing before, because it's very difficult to find out
why your WHEN clause isn't working - it's only a very small remark in the
reference book.
I'm afraid you have to live with it...

Dr. Michael Ebert
DB2 Database Administrator
aMaDEUS Data Processing
Erding / Munich, Germany




From: Glen Sanderson <[login to unmask email]>@IDUGDB2-L.ORG on
13-01-2005 14:44 CST

Please respond to DB2 Database Discussion list at IDUG
<[login to unmask email]>

Sent by: DB2 Data Base Discussion List <[login to unmask email]>



To: [login to unmask email]


cc:






Subjec [DB2-L] Trouble with unloading
t: ASCII data








I was trying to unload data from an ASCII DB2 table using the following
syntax:
UNLOAD
TABLESPACE XXDBNAME.XXTSNAME
FROMCOPYDDN SYSBKUP
ASCII
FROM TABLE OWNER.XXTABLE
HEADER NONE  WHEN (HEAD_NAME='RW330-DR-USA')

Several other conbinations of the WHEN clause such as LIKE 'RW330%' and
HEAD_NAME >= 'RW330       ' AND HEAD_NAME <='RW330ZZZZZZZ' did not work
either.
The only method that did work was using the HEX equivalent:
WHEN (HEAD_NAME = X'52573333302D44522D555341' )

Is there any other method to unload data without having to "translate" the
WHEN
clause into HEX?
---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm