Extracting data from a DB2 table using IKJEFT01

5 pts.
Tags:
DB2
DB2 Table
IKJEFT01
SQL Query
I'm trying to extract data from a DB2 table via an SQL query and use IKJEFT01 to create a flat file. However, one of the non-key fields contains characters that are not nulls but non-printable. Whenever IKJEFT01 extracts these characters it changes them to nulls in the flat file. Is there an alternative IBM utility that will not change the non-printable characters stored in the DB2 table? - I want to extract the data in its original form. Thanks, Alan
ASKED: October 21, 2008  12:30 PM
UPDATED: September 22, 2009  2:04 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

IKJEFT01 is TSO.

I think you may need a little more understanding of NULL. Anything outside of DB2 would not comprehend NULL values as defined in DB2. When DB2 shows a value as NULL, it is based upon an indicator (the null indicator). There actually is data of some kind in the column. After all, every byte must have some value; something between x’00′ and x’FF’. It is only the NULL indicator that tells DB2 the column is NULL. Once the data is outside of DB2, you will have to be very careful. There is something in that column. Even inside DB2, when you retrieve a column that is set to NULL, there is data in the column. That is why you must always check the null indicator in a program. And that is why in SQL you must always use WHERE column IS (or is not) NULL.

Now the flat file. There is something in the field that came from the nullable column. It may be nondisplayable on your terminal or nonprintable on your printer. But there is something in every byte; something between x’00′ and x’FF’. There is no NULL character.

To look at the values In ISPF editor, try issuing HEX ON.
Or print the file with IDCAMS or IEB…

Remember, you will have to check the null indicator in your SQL query and treat the columns that are NULL in some sort of special manner before writing to a flat file.

If you use DB2′s sample unload program the NULL indicator will be output to your flat file.

Steve

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following