Date: Fri, 28 Jun 2002 11:45:03 -0400
Reply-To: Michael Raithel <RAITHEM@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <RAITHEM@WESTAT.COM>
Subject: Re: Calling a UNIX shell script.
Content-Type: text/plain; charset="iso-8859-1"
Dear SAS-L-ers,
Philip Crane posted the following:
>The following command calls and correctly executes my shell script (HP
>unix)
>
> 39 %sysexec /home/regulation/cranp1/sasarch.sh;
>
>But when I try to pass some parameters with it; like this
>
> 40 %sysexec "/home/regulation/cranp1/sasarch.sh &path &file";
>
>it does not. It appears as though unix treats the whole string as the name
>of an object that it tries to execute and then complains it cannot find it.
>Can someone please advise on how to nominate a shell script to run and pass
>parameters to it.
Phillip, I see that you have already received great advice from both Floyd
Nevseta and Ace in Basel. I, of course, have a different slant; here is
what I often (successfully) do:
data _null_;
call system("/home/regulation/cranp1/sasarch.sh &path &file");
run;
As long as the &path and &file SAS Macro variables have already been created
and are accessible to my DATA NULL step, they resolve correctly and are
passed onto Unix.
Phillip, best of luck to you as you shoot it out with that most "wild west"
of operating systems: Unix.
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect
those of my organization or my associates. All SAS code and/or methodologies
specified in this posting are for illustrative purposes only and no warranty
is stated or implied as to their accuracy or applicability. People deciding
to use information in this posting do so at their own risk.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail: MichaelRaithel@westat.com
Author: Tuning SAS Applications in the MVS Environment
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The most overlooked advantage to owning a computer is that if
they foul up, there's no law against whacking them around a
little. - James A. Porterfield
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++