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
lynnliu
Premium Member
Posts: 40 Joined: Tue Oct 28, 2003 7:13 pm
Post
by lynnliu » Mon Nov 01, 2004 6:06 am
hi,
i want to get the 36 base decimal through the unix shell like bellows,
in DataStage routine using
Code: Select all
InputArg = 'echo "obase=36;'
InputArg = InputArg : LongNum: '"|bc'
Call DSExecute("UNIX",InputArg,Output,SystemReturnCode)
But i can not catch the output of the shell.
How to catch the output of this kind of shell?
Regards
Thanks!!
ogmios
Participant
Posts: 659 Joined: Tue Mar 11, 2003 3:40 pm
Post
by ogmios » Mon Nov 01, 2004 7:30 am
It's your output argument.
Put a DSLogInfo using output after executing the instruction.
Also watch out that anything you run with DSExecute runs using a very minimal UNIX environment unless you make changes to your DataStage installation.
Ogmios
In theory there's no difference between theory and practice. In practice there is.
Amos.Rosmarin
Premium Member
Posts: 385 Joined: Tue Oct 07, 2003 4:55 am
Post
by Amos.Rosmarin » Mon Nov 01, 2004 9:10 am
meaning
Code: Select all
Call DSLogInfo ("output is - " : Output , '')
and you'll see it in the log
HTH
lynnliu
Premium Member
Posts: 40 Joined: Tue Oct 28, 2003 7:13 pm
Post
by lynnliu » Mon Nov 01, 2004 7:45 pm
sorry, i didn't explain clearly.
i know that the output in the Output argument.
i using DSLogInfo in my routine
Code: Select all
call DSLogInfo("*** Output from the command was: ":Output, RoutineName)
i got only one blank space in Output.
if the command like this :
,the Output return "9999". I don't know how to get the result of this command
Thanks!!
magma
Premium Member
Posts: 10 Joined: Wed Apr 14, 2004 11:35 pm
Location: Australia
Contact:
Post
by magma » Mon Nov 01, 2004 8:22 pm
works for me if I try...
echo "obase=36 \n 9999" | bc
Last edited by
magma on Mon Nov 01, 2004 8:26 pm, edited 2 times in total.
Michael
Magma Computing Solutions
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Mon Nov 01, 2004 8:22 pm
$echo is a reference to a shell variable. Perhaps that shell variable is not defined, or has "" assigned to it? This would be a "do nothing" command with no output.
Try it without the $ character at the beginning.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lynnliu
Premium Member
Posts: 40 Joined: Tue Oct 28, 2003 7:13 pm
Post
by lynnliu » Mon Nov 01, 2004 8:58 pm
Michael, you mean you can get the same output in DSExecute as in terminal? My problem is it works well in terminal but not in DSExecute.
Ray, i didn't use "$" in my routine. i used it to explain the shell command in last post . Is the problem of double quotation marks or pipe operator?
lynnliu
Premium Member
Posts: 40 Joined: Tue Oct 28, 2003 7:13 pm
Post
by lynnliu » Mon Nov 01, 2004 9:06 pm
The Problem solved!! Thanks All!!
i change the command to
In DSExecute:
Code: Select all
call DSExecute("UNIX","echo 'obase=36;9999'|bc",Output,SystemReturnCode)
it works!!