Sequential file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Sequential file

Post by kittu.raja »

Hi,
When I am trying to load data from one flat file to another flat file which has nulls, I am getting a warning " exporting Nulls without Null handling properties" I tried to Null handle in the transformer then also its says the same thing. In the Output file I should have nullability as yes for some columns. Can anybody help me out.
Rajesh Kumar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First suggestion - take your actual "exporting nulls" error and search the forums for that exact string.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

chulett wrote:First suggestion - take your actual "exporting nulls" error and search the forums for that exact string. ...

Mine is the only message it has in the forum. Nobody has raised this issue before
Rajesh Kumar
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Try to load it into Dataset it would be much faster and Null handling will be taken care much easily here.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kittu.raja wrote:
chulett wrote:First suggestion - take your actual "exporting nulls" error and search the forums for that exact string. ...
Mine is the only message it has in the forum. Nobody has raised this issue before
No, you're not. Use a common portion of your actual error, not what you put in your first post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

Ya true but we want in sequential file only.
Rajesh Kumar
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

Ya true but we want in sequential file only.
Rajesh Kumar
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

chulett wrote:
kittu.raja wrote:
chulett wrote:First suggestion - take your actual "exporting nulls" error and search the forums for that exact string. ...
Mine is the only message it has in the forum. Nobody has raised this issue before
No, you're not. Use a common portion of your actual error, not what you put in your first post.
I searched by "Exporting Nulls" but it doesnt have anything
Rajesh Kumar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Odd, I found this thread.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Is the source file being created by DataStage? If so, then set the Null handling settings in the stage that creates the Sequential file.
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

jdmiceli wrote:Is the source file being created by DataStage? If so, then set the Null handling settings in the stage that creates the Sequential file.

No, I am getting a flat file from other source. Its not created by datastage. I handled the nulls then also its says the same.
Rajesh Kumar
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Post by kittu.raja »

ArndW wrote:Odd, I found this thread. ...
Yup I got it. But is there any other way. my file has 53 columns and 30 columns have null in them. Now i have to append spaces to 30 columns?
Rajesh Kumar
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Are these essentially showing up as non-printing characters? Or maybe characters outside the standard ASCII range (32-127 I think)? If so, try this:

Create a routine called 'RemoveNonPrintingChars' (or whatever - it doens't really matter). There will be one argument called 'Arg1' and the code goes like this:

Code: Select all

      Text = Arg1

      If Text=OCONV(Text, "MCP") Then
         Ans = Text
      End Else
         LetterCount=LEN(Text)
         Ans = ""
         For i=1 to LetterCount
            letter=Text[i,1]
            AsciiLetter=SEQ(letter)
            Begin Case
               Case AsciiLetter < 32 Or AsciiLetter > 127
                  letter = " "
            End Case
            Ans := letter
         Next i
      End
This code is from V8 by the way. I don't know if this will do you any good, but give it a shot.

If you want to pre-process the entire flat file, then you could do it with a little Perl script at the command prompt level (assuming you are just substituting a non-printing character with a space). That code looks like this:

Code: Select all

#!/usr/local/bin/perl -w

use strict;
use warnings;

my ($filepath, $filename, $newfilename, $line, $hold);
my @array;

$hold = '';

$filepath = "$ARGV[0]";
$filename = "$ARGV[1]";
$newfilename = "$filepath" . "fix_" . "$filename";

$filename = "$filepath"."$filename";

open(O,"< $filename")||die "Could not open $filename for processing!\n";
open(F,"> $newfilename")||die "Could not open $newfilename for processing!\n";

while ($line = <O>)
{
        if ($line =~ //)
        {
                $line =~ s// /g;
                $hold = $hold . $line;
                chomp $hold;
                next;
        }

        if (($line =~ /\n/) and (length($hold)> 0))
        {
                $hold = $hold . $line;
                print F $hold;
                $hold = '';
                next;
        }

        # if none of the other option have appeared then this is a normal row
        print F $line;
}
close (O);
close (F);

# rename($newfilename,$filename);
The last line of the script above (rename) is commented out. Running this will let you test without destroying your original file. Once tested, you could remove the pound and this will then rename the working file to the same as your original, overwriting it. You may have to modify the code above to suit your needs, but I would be interested to know if it works for you. :?:

Hope that helps!
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

If your files are not fixed width, then do a search on this APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL.
The solution will be to do two things.
1. Add that env variable to your Project and set it to True
2. Define the default for any field that contains a NULL to "" (empty) at the line level.
Post Reply