Sequential File Null Value Field

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
kanasai167
Participant
Posts: 63
Joined: Mon Sep 12, 2011 2:11 am

Sequential File Null Value Field

Post by kanasai167 »

I got a input file (.csv format) like this :

Name,Date,Amount
ABC,2000-11-11,1000
DEF,,
GHI,,



When i try to view the data in Sequential File stage , error popup. I believe is because of null value field in my input file.
However i set the Date field default value to 2000-01-01 but still receive error. Under the Sequential File option , i already set the Date Format String to %yyyy-%mm-%dd.
Same issue goes to my Amount field which is an Integer data type field.
After i set the Amount field default value to 0 then no more error on Amount Field. But i want my field remain NULL...
Is there any settings allows us to capture a null Date and Integer value in Sequential File.



Error message on Date Field :
##W IIS-DSEE-TFDA-00036 15:25:22(000) <Sequential_File_1,0> Data string ',,,,,,,CR,' does not match format '%yyyy-%mm-%dd': an integer was expected to match tag %yyyy.
##W IIS-DSEE-TFIG-00186 15:25:22(001) <Sequential_File_1,0> Field "CLOSING_DATE" delimiter not seen, at offset: 67
##W IIS-DSEE-TOIX-00154 15:25:22(002) <Sequential_File_1,0> Import warning at record 0.
##W IIS-DSEE-TOIX-00018 15:25:22(003) <Sequential_File_1,0> Import unsuccessful at record 0.
##W IIS-DSEE-TFDA-00036 15:25:22(004) <Sequential_File_1,0> Data string ',,,,,,,SR,' does not match format '%yyyy-%mm-%dd': an integer was expected to match tag %yyyy.
##W IIS-DSEE-TFIG-00186 15:25:22(005) <Sequential_File_1,0> Field "CLOSING_DATE" delimiter not seen, at offset: 70
##W IIS-DSEE-TOIX-00154 15:25:22(006) <Sequential_File_1,0> Import warning at record 1.
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Post by chetan.c »

Hi,
Please try this.
Sequential file stage-->output tab--->Format tab--->Field defaults.
On the right side you will see "Available properties to add".
Select Null Field Value.

Thanks,
Chetan.C
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Note that there are no null fields in a sequential file, only empty ones and they are not the same thing. The property mentioned will allow you to define the "in-band null" value for that field, what incoming value should be transformed to a null during import.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

chetan.c wrote:Select Null Field Value.
And set it to '' which is the empty string (2 single quotes).
Choose a job you love, and you will never have to work a day in your life. - Confucius
kanasai167
Participant
Posts: 63
Joined: Mon Sep 12, 2011 2:11 am

Post by kanasai167 »

it works , thanks
Post Reply