Text file Record count using Wrapper

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
mnvihol
Participant
Posts: 26
Joined: Thu Feb 03, 2005 10:46 pm

Text file Record count using Wrapper

Post by mnvihol »

I have a db table which contains file names in one field and i need to count number of rows in text file flow is
input: DB2 stage-> count file row using wrapper stage-> Output: file name, row count. e.g if table have 10 rows containing 10 file name then output should be 10 rows (file name+ file row count)

Command in wrapper is wc -l file name but how can we dynamically pass file name as command argument ? any idea or alternate way to do this

Also in wrapper stage which i have created for testing i am getting compilation error
"#W TCOS 000049 07:13:27(007) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##E TFCP 000006 07:13:28(000) <transform> Error when checking composite operator: The -flag=compile option was used, but no input schema was specified.
##E TFSR 000019 07:13:28(001) <main_program> Could not check all operators because of previous error(s)
##E TCOS 000029 07:13:28(002) <main_program> Creation of a step finished with status = FAILED. (Wrapper.Transformer_1)"

Command in wrapper stage is wc abc.sh

Thanks
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Never used a wrapper. But like server job transformer, is the unix sheel script run is possile do it from thr?
Regards,
S. Kirtikumar.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I wouldn't use a Wrapped stage (note the correct name) within a job; I'd use an Execute Command activity in the controlling job sequence, much simpler. A Wrapped stage in a job must execute for each row processed.

You would need to define the input and output interfaces to the Wrapped stage. You probably want a property called something like "File". When you invoke the stage in a job design, you can supply a value or a job parameter reference as the value for this property. And - in your case - you would probably need to enforce sequential execution mode, introducting a bottleneck to your processing. Invoke Help and read the topic Wrapped Stream Dialog Box, clicking on the diagram as necessary.
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