What I do is create a variable and pass the invidual variables to that, then
send the main variable to the command. This is test code so its messy, don't
judge! :)


DCL VAR(&CMD) TYPE(*CHAR) LEN(200) VALUE(' ')

CHGVAR VAR(&CMD) VALUE('test' *CAT &SNGQTE *CAT +
'/TEST/IMAGES/' *TCAT &$INPUT *TCAT +
&SNGQTE *CAT ' ' *CAT &SNGQTE *CAT +
'/TEST/IMAGES/' *TCAT &$OUTPUT *TCAT &SNGQTE)

CALL PGM(QP2SHELL) PARM('/QOpenSys/usr/bin/sh' +
'-c' &CMD)


Leonard


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of ssc1478
Sent: Wednesday, April 07, 2010 11:01 AM
To: Midrange Systems Technical Discussion
Subject: Passing arguments with Q2PSHELL

I am trying to figure out how to pass arguments to the command that I
am also passing to Q2PSHELL. I've been googling but so far haven't
found the answer I'm looking for.

This is the command in my CL pgm:
CALL PGM(QP2SHELL) PARM('/QOpenSys/bin/sh' '-c' +
&SCRIPTFQ &SRCFILE &TGTFILE
&CURUSER &TGTHOST)

&SCRIPTFQ is the name of the script that I want to be executed. This
works - it is being executed.
The remaining 4 variables I want passed to the script in &SCRIPTFQ.

I've tried a few different things but none so far have worked.

Each variable is null terminated. The OS version is 6.1.

If I call Q2PTERM at the command line and then execute the script with
the arguments, it works. So I'm confident that my problem is with my
not understanding how to pass the arguments.

Thanks in advance for any help!

Phil

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.