Writing into Sequential file on Unix Solaris
Jonbickel@aol.com
Jonbickel@aol.com
Wed, 30 Apr 2003 08:58:17 -0400
Sagar,
Two points on this issue.
1)As the others pointed out, any environment variable set via
A RUN COMMAND statement will have scope only within the shell
created by that RUN COMMAND (i.e. variables set in one RUN COMMAND
will not be set/visible to a process under a separate RUN COMMAND).
An environment variable set with SETSYSTEMVAL will inherit from your
session down to any called via RUN COMMAND.
2)Regarding a command working at the command line and not via RUN COMMAND.
You are probably dealing with a different shell at the command line than
you are in the RUN COMMAND, and the syntax is, therefore, slightly variant.
In my environment, for example, the standard command line shell on login is c-shell (/bin/csh),
but the command interpreter for RUN COMMAND is the bourne shell (/bin/sh).
So, setting a variable at the command line would be (for me):
set myvar=value
or
setenv myvar value
But setting a variable in an unqualified RUN COMMAND shell would be (for me):
myvar=value
or
myvar=value;export
(Note that this is also the shell used when accessing the command line from QUIZ/QTP via the "!".)
Depending on what you are doing in the run command, you could force it into the
shell of your choice (csh, ksh, sh, etc...) via an explicit call like the one in
Mark's example below.
Best Regards Also,
Jon
>
> Message: 2
> From: "Fry, Mark" <Mark.Fry@COGNOS.com>
> To: "'Goparaju, Vidyasagar'" <VGoparaju@tradepointsystems.com>,
> "'powerh-l@lists.swau.edu'" <powerh-l@lists.swau.edu>
> Subject: RE: Writing into Sequential file on Unix Solaris Powerhouse envir
> onment
> Date: Wed, 30 Apr 2003 10:46:42 +0100
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> ------_=_NextPart_001_01C30EFD.67F2B560
> Content-Type: text/plain;
> charset="iso-8859-1"
>
> Hi Sagar,
>
> If you want to get this to run on unix without an error, it needs a unix
> shell to run within.
>
> You could try this:
>
> RUN COMMAND "sh -c 'GENRIC=<file name>'"
>
> I'm not sure what this would accomplish here, though. As soon as the
> command is complete, the shell is closed and the environment variable
> (GENRIC) disappears with it...
>
> Better to use the SETSYSTEMVALUE function, as suggested by Terry Curran ie
>
> IF NOT SETSYSTEMVALUE( "GENRIC", "<file name>" )
> THEN ERROR "Cannot set value"
>
> Best regards,
>
> Mark Fry
> Mark.Fry@Cognos.com
>
> -----Original Message-----
> From: Goparaju, Vidyasagar [mailto:VGoparaju@tradepointsystems.com]
> Sent: 29 April 2003 21:23
> To: 'powerh-l@lists.swau.edu'
> Subject: RE: Writing into Sequential file on Unix Solaris Powerhouse
> envir onment
>
>
> Hi All,
>
> I am getting runtime error in QUICK when I set the system variable using RUN
> COMMAND "GENRIC=<file name>"
>
> I tried RUN COMMAND "set GENRIC=<file name>" also. It did not work. Same
> command is working OK when I type it on the command line.
>
> Please help.
>
> Thanks
> Sagar
>