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

Removing NULLIF columns in UNLOAD?


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

New User


Joined: 09 Nov 2008
Posts: 2
Location: Mexico City

PostPosted: Fri Aug 27, 2010 12:56 am
Reply with quote

Hello,

I'm currently trying to unload a table to a flat file using DSNTIAUL. This file is gonna be processed and then loaded in the same table.

Some of the columns in the table are nullable, so the unloaded file (and the SYSPUNCH, of course) is full of extra NULLIF columns.

This complicates a little the processing and posterior LOAD of the file. I'd like my file without those NULLIF columns, if possible.

I'm aware I could remove those columns using ICETOOL, or a number of other options.

But I wonder... is it possible to set the UNLOAD in such a way that it does not generate those NULLIF colums?

Thanks!
Back to top
View user's profile Send private message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Fri Sep 17, 2010 3:39 pm
Reply with quote

Just my guess, you can try the query select columns where your_columns is not null in your unload card?
Back to top
View user's profile Send private message
vina2010

New User


Joined: 06 Sep 2010
Posts: 19
Location: Bangalore

PostPosted: Fri Sep 17, 2010 4:28 pm
Reply with quote

Hi Jose Solis

If you have the restriction to select the NULLABLE column using DB2 query then use VALUE(column,' ') to convert the Nullable characters to SPACES.
Then you can use a simple DFSORT/ICETOOL to reformat this file by dropping this field.

Hope this helps.
Back to top
View user's profile Send private message
Jose Solis

New User


Joined: 09 Nov 2008
Posts: 2
Location: Mexico City

PostPosted: Tue Sep 28, 2010 7:00 pm
Reply with quote

bamohan, vina2010:

Thank you for yor replies...

I ended up including those NULLIF fields in the process and the LOAD card. It worked ok... Problem solved...

Thank you,
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Mar 19, 2012 7:25 pm
Reply with quote

Hello all,

I am facing exactly same issue. but unable to figure out the problem. tried many ways. but m getting still spaces in my flat file.Please help me in this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 20, 2012 9:00 am
Reply with quote

Hello,

I suspect you need to post considerably more information for someone here to be able to help. . .

Show the part of the query that does not work as you want.
Show a bit of the problem data.
Explain what you want instead of what is created now.

Use to "Code" tag to preserve alignment and improve readability.
Back to top
View user's profile Send private message
Parthiban DS

New User


Joined: 07 Aug 2011
Posts: 5
Location: India

PostPosted: Wed Mar 21, 2012 7:36 pm
Reply with quote

Hello,

Below process may slove your problem.

1. Unload the data from table using DSNTIAUL. This will unload the data with NULL indicators into SYSREC00
2. Process the data.
3. Load the data into the table using DSNUTILB. you can use SYSPUNCH dataset of the UNLOAD to create the LOAD card.

Hope this will help you.


-Parthi
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 Increase the number of columns in the... IBM Tools 3
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top