Retrieve from Unix 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
yxie
Premium Member
Premium Member
Posts: 10
Joined: Tue Apr 03, 2007 3:46 pm

Retrieve from Unix file

Post by yxie »

I am trying to retrieve data from unix file through Sequential File Stage, the layout of file is like following

1....2 ......3 ........165......200....257
-------------------------------------------
1; 235; 9090;.... 0000;
2; 353; 8849;.... 3666;... .... ....7780;
3; 536; 4672;.... 5745;... 8383;

it has about 257 columns with ; delimited, my problem is that only those records with data in all 257 fields will show up, which means in above example record 1 and 3 won't be retrieved, even I set each column nullable in table definition. The server is Linux redhat.

Please give any adv how to retrieve the entile data set
Thanks a lot
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pre-process the file so that each line has 256 ";" characters. You could even do this in DataStage; read the line as a single VarChar field, add the appropriate number of semi-colons

Code: Select all

InField : Str(";",256-Count(InField,";"))
then re-parse using Column Import stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
yxie
Premium Member
Premium Member
Posts: 10
Joined: Tue Apr 03, 2007 3:46 pm

Post by yxie »

Thanks Ray, Could you tell me where should I put this code to, Sequential file stage?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Transformer stage downstream of the Sequential File stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply