Executing Unix script from routine...

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Executing Unix script from routine...

Post by meena »

Good Morning All,
I wrote a routine to execute UNIX script. As I need the ouptut of the UNIX scirpt, I wrote a new routine instead of using the 'Execute Command' in the sequencer.

Code: Select all

Command="ksh +x" : Arg: "/InputFilesCount.sh"
Call DSExecute("UNIX",Command, Output, SystemReturnCode) 

Ans= Output <1>
This routine compiles but when I am testing it gives an error as bad option.

Thanks in advance,
Aruna Evoori
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is Arg in your routine? Is it really Arg or Arg1.
Plus you need a space between ksh +x and your argument.

Code: Select all

Command="ksh +x ":Arg:"/InputFilesCount.sh"
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
smrutiranjannayak
Participant
Posts: 22
Joined: Mon Apr 02, 2007 4:02 am
Location: MUMBAI
Contact:

Alternate solution

Post by smrutiranjannayak »

Hi ,

If it is related to running a Shell script (Unix) Then you can do that using ExecSH option too .
If that is permitted then just execute a after/before subroutine
and give execsh option and in value give ur shell script path
( if ur script needs some parameters you can give along with that also .
Try executing this way.........

It will work

cheers :lol:
Smrutiranjan Nayak
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Thanks a lot...

The routine is working , the error is because of the space.
Aruna Evoori
Post Reply