PDA

View Full Version : PHP mit Parametern aus CL-Programm aufrufen



Bitverdreher
24-06-11, 11:57
Hallo zusammen,

ich möchte aus einem CL-Programm heraus ein PHP-Script aufrufen und an dieses 2 Parameter übergeben.

Der Aufruf ohne Parameter funktioniert:
CALL PGM(QP2SHELL)
PARM('/USR/LOCAL/ZEND/CORE/BIN/PHP' +
'/WWW/ZENDCORE/HTDOCS/SCRIPT.PHP')

Wie muß ich aber Parameter mit übergeben?
'/WWW/ZENDCORE/HTDOCS/SCRIPT.PHP?P1=1&P2=2') funktioniert nicht, hier erhalte ich die Fehlermeldung "Could not open input file"

Hat jemand eine Idee?

WoD
24-06-11, 12:27
hallo,

hab das aus IBM-Doku

V5R4


If you pass values into QP2SHELL() using CL variables, the variables must be null-terminated. For example, you need to code the above example in the following way:

PGM DCL VAR(&CMD) TYPE(*CHAR) LEN(20) VALUE('/QOpenSys/bin/ls')

DCL VAR(&PARM1) TYPE(*CHAR) LEN(10) VALUE('/')
DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')

CHGVAR VAR(&CMD) VALUE(&CMD *TCAT &NULL)
CHGVAR VAR(&PARM1) VALUE(&PARM1 *TCAT &NULL)

CALL PGM(QP2SHEL PARM(&CMD &PARM1)