Problem with external source 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
kumarjit
Participant
Posts: 99
Joined: Fri Oct 12, 2012 7:47 am
Location: Kolkata

Problem with external source stage

Post by kumarjit »

I am using and External Source stage to fetch output from a simple Unix Shell script(the script reads the text file and prints lines in a specific format) and pass it to the downstream processing.

The problem with the External Source stage is:
When I am selecting Source Method=Program File(s) and selecting selecting the Shell script file, the job aborts with the following message

Code: Select all

Source subproc: sh: -c: line 1: syntax error: unexpected end of file

On the contrary, when I change the Source Method to Specific Program(s), and set the Source Program property to execute the same script, something like :

Code: Select all

cd <file_path>; ./<script_name>.sh
, the job runs successfully.

Can somebody please me understand this erratic Datastage behavior ?


PS: I checked that shell in which Datastage is invoking the script is /bin/bash


Regards,
Kumarjit.
Pain is the best teacher, but very few attend his class..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My guess would be that the last line of the script lacks a line terminator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumarjit
Participant
Posts: 99
Joined: Fri Oct 12, 2012 7:47 am
Location: Kolkata

Post by kumarjit »

Thanks for the suggestion Ray, but if that was a problem at the script level, the script would have never run at the first place.

But as I said, the script works perfectly standalone, or when run with Specific Program(s) option set in the stage.


Regards,
Kumarjit.
Pain is the best teacher, but very few attend his class..
Post Reply