View previous topic :: View next topic
|
Author |
Message |
Jose Solis
New User
Joined: 09 Nov 2008 Posts: 2 Location: Mexico City
|
|
|
|
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 |
|
|
bamohan
New User
Joined: 29 Jan 2007 Posts: 33 Location: chennai
|
|
|
|
Just my guess, you can try the query select columns where your_columns is not null in your unload card? |
|
Back to top |
|
|
vina2010
New User
Joined: 06 Sep 2010 Posts: 19 Location: Bangalore
|
|
|
|
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 |
|
|
Jose Solis
New User
Joined: 09 Nov 2008 Posts: 2 Location: Mexico City
|
|
|
|
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 |
|
|
sravz chinnu
New User
Joined: 07 Dec 2011 Posts: 26 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Parthiban DS
New User
Joined: 07 Aug 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
|