Page 1 of 1

Problem with external source stage

Posted: Fri Nov 20, 2015 12:51 am
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.

Posted: Fri Nov 20, 2015 6:12 pm
by ray.wurlod
My guess would be that the last line of the script lacks a line terminator.

Posted: Wed Nov 25, 2015 12:32 am
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.