|
Fresh upgrade to V7.1 with latest PTFs as of a few weeks ago (so not the latest anymore).
I can probably find another way to make this work, but I'm not sure why it doesn't work the way I'm trying.
I have an existing RPGLE program that calls an existing CL program. I'm modifying that CL program to run a PHP script instead of what it used to do (which was print a report and use FastFax to email a PDF of it.)
Simple test to see what's happening, RPGLE program replaced with:
DTSNO07 S 10 INZ('0000120137')
DEMAIL S 30 INZ('valuenotused')
C CALL 'MYCLPGM'
C PARM TSNO07
C PARM EMAIL
C RETURN
I wanted to rule out any command line CALL parameter issues by having RPGLE call the CL like the original.
The CL program has the parameters defined the same:
PGM PARM(&CALL# &EMAIL)
DCL VAR(&CALL#) TYPE(*CHAR) LEN(10)
DCL VAR(&EMAIL) TYPE(*CHAR) LEN(30)
CALL PGM(QP2SHELL) PARM('/usr/local/zendsvr/bin/php-cli' +
'/home/qpgmr/help2rt.php' &CALL#)
If I DMPCLPGM, I can see the &CALL# contains what it should. When my PHP script gets it, it has garbage at the end, but only one character visible in the error that prints. It doesn't come over to text based email when I copy/paste from the screen.
I thought maybe I should put single quotes around it, and I did manage to get that to PHP correctly when I built a *CHAR 12 field in CL, but then the value passed in has quotes and doesn't match the field in my database that doesn't have quotes.
The part I don't understand is &CALL# above not being just 10 characters when it gets over to PHP.
If I run it from a command line, it works fine:
CALL PGM(QP2SHELL) PARM('/usr/local/zendsvr/bin/php-cli'
'/home/qpgmr/help2rt.php' '0000120137')
--
Sean Porterfield
This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged. If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited. Thank you.
As an Amazon Associate we earn from qualifying purchases.
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.