In Sequential file output

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
venkates.dw
Participant
Posts: 67
Joined: Mon Dec 22, 2008 4:07 am

In Sequential file output

Post by venkates.dw »

I am having sequential file as source....

my input data is

deptno,dname,loc
10,aaa,hyd
20,bbb,ban
30,,che

in third row i am not having the dname information ...

but i want to replace empty dname with 'xxxx'...

i.e.,

o/p:

dno,dname,loc
10,aaa,hyd
20,bbb,ban
30,xxxx,che

give the process please......
kamalshil
Participant
Posts: 179
Joined: Mon Jun 23, 2008 1:19 am

Post by kamalshil »

read the sequential file as i/p and feild delimiter as comma
then pass the output to transformer stage
and try to following logic:

Code: Select all

isNull(columnname) then
"XXX"
else
columnname 
And now pass this transformer result to target it will help.
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Venkates, better read DS documentation to know the basics of DS functionality.
Kandy
_________________
Try and Try again…You will succeed atlast!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Kamashil's suggestion will only work if your Sequential File stage that reads the file converts missing values to null. This is, of course, the default setting. If, however, you represent null differently, then you need specifically to handle the missing value differently, perhaps with a test against the literal string "".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SagarMelam
Participant
Posts: 26
Joined: Mon Apr 21, 2008 4:03 am
Location: Amalapuram

Re: In Sequential file output

Post by SagarMelam »

Create a stage variable for dname column and write the derivation as If (dname=''then 'XXXX' else dname).This will work check it out
Sagar
Post Reply