Handling NULL indicator in DB2 Unload.

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

Handling NULL indicator in DB2 Unload.

Post by Binamra »

While unloading a table im Using two columns value and multiplying it and assigning to receiving table table columns which is decimal(15,2) not null.. but in the unload file it is adding one more byte in the last for null indicator.

So one byte is moving right and while loading the table using that file it fails.

Can some one help how to avoid this one byte for null indicator in the unload file

[ Post made via Android ] Image
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Handling NULL indicator in DB2 Unload.

Post by Anuj Dhawan »

Hi,

From memory, I recall that - once you unload the table, you should get a SYSPUNCH dataset. It should give you the 'load card' using in that. The unload dataset will have the data as per the 'definition' in SYSPUNCH dataset - with all this you should be good to go.

OR COALESCE should help you. Give that too a try.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
singhxmanish
New Member
Posts: 1
Joined: Sat Mar 24, 2018 11:11 pm

Re: Handling NULL indicator in DB2 Unload.

Post by singhxmanish »

One way could be to use DFSORT to eliminate the null after the field (in unload file) and structuring the data as per table to be loaded. Since the null is placed after the field I assume you used DSNTIAUL and null would be stored as ? Or X’6F’
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

Re: Handling NULL indicator in DB2 Unload.

Post by Binamra »

singhxmanish wrote: Sat Mar 24, 2018 11:34 pmOne way could be to use DFSORT to eliminate the null after the field (in unload file) and structuring the data as per table to be loaded. Since the null is placed after the field I assume you used DSNTIAUL and null would be stored as ? Or X’6F’
Thanks but that will require one more step. I was looking for way which can be handled by DB2 itself.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Handling NULL indicator in DB2 Unload.

Post by nicc »

I was looking for way which can be handled by DB2 itself.
Why did you not say so in the first place?
Regards
Nic
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

Re: Handling NULL indicator in DB2 Unload.

Post by Binamra »

I did not mean to say that it was required for me, I was just trying to make it clear that it would take one extra step.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”