Wrapped Stage

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
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Wrapped Stage

Post by sanjay »

Hi

I have a scenario . i have a Flat file . i want remove trailer an header and record and discard record which are lesser and greater than specified column . for that i have written unix script . i want use wrapped Stage in PX to call that unix script . but my problem is unix script creates file after removing trailer . header and lesser and greater than specified column . can i use wrapped stage to avoid creation of file instead directly pass to transformer stage . so can i use wrapped stage like passive stage .


Sanjay
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Surely the Wrapped stage will be called for every row processed?!

What you really want to do is to pre-process the file, perhaps in a before-job subroutine that executes an appropriate operating system command (or shell script). A before-job subroutine is executed exactly once.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Post by sanjay »

Hi ray

thanks for u reply . i wanted it read the file only once not 2 times . before job will read and put in file and file i have to read again with sequential File stage . i dont want that to happen . i want read just once that sequential file and wrapped stage should send the output to a trasformer.

Sanjay

ray.wurlod wrote:Surely the Wrapped stage will be called for every row processed?!

What you really want to do is to pre-process the file, perhaps in a before-job subroutine that executes an appropriate operating system command (or shell script). A before-job subroutine is executed exactly once.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have to create a script that puts its result onto stdout (to which the output link from the Wrapped stage is connected). Only in this way can you prevent a file from being created.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
alanwms
Charter Member
Charter Member
Posts: 28
Joined: Wed Feb 26, 2003 2:51 pm
Location: Atlanta/UK

Post by alanwms »

You may want to look at the External Filter stage. Be aware that some of these stages require the data to move via stdin/stdout.

Another alternative is to just let the header and trailer records fall out the rejects link of the Sequential File stage, since the metadata probably won't match that of the regular rows. There are several options available for reject processing. Also be aware that the data for any rejected rows would be output in a single column.

Alan
Post Reply