|
Michael,
The trick to debugging RPG programs from stateless toolkit jobs (that run
in QSQSRVR) is the ‘*debug’ control key. Instructions below excerpted from
my PHP toolkit presentation (http://www.alanseiden.com/presentations/ <
http://www.alanseiden.com/presentations/>):
1. Add the following line to your PHP script before the program call to be
debugged. $toolkitConn should be your toolkit connection object.
$toolkitConn->setOptions(array('customControl'=>'*debug'));
Run your script. The script will "hang" while it waits on #2 below...(move
to green screen 5250 for steps 2-10)
2. A MSGW inquiry message in DSPMSG QSYSOPR will be generated by the
toolkit.
3. Note the job information (number, name, user) provided in the MSGW.
4. STRSRVJOB using that job information as parameters.
5. STRDBG with the program and library you wish to debug.
6. Answer the MSGW. Any answer will do--"G" is fine.
7. The RPG program source will appear in debug mode in your terminal,
ready to step through, allowing you to inspect variables, etc.
8. When done inspecting and stepping, let the RPG program complete (using
function keys indicated on screen).
9. ENDDBG
10. ENDSRVJOB
Alan
--
Alan Seiden Consulting LLC
Project leader, Zend PHP Toolkit for IBM i
Zend Framework certified contributor
Office: 201-447-2437 Cell: 201-248-4704
http://www.alanseiden.com | alan@xxxxxxxxxxxxxx
http://twitter.com/alanseiden
On Mar 28, 2016, at 9:52 AM, Michael Ryan <michaelrtr@xxxxxxxxx> wrote:Toolkit
I need to occasionally debug the PHP script->i program interaction,
especially when I need to see parameters being passed or to trace logic
flow. When I run in stateful more, I'm able to use STRSRVJOB on the
job, and then STRDBG on the program or service program. However, when Iuse
stateless mode, the job uses a QSQSRVR job and I don't know which onewill
be used.posted
I was thinking I could have the PHP script send a SNDMSG command with an
*INQ so I could identify the QSQSRVR job being used. This works, but the
PHP script doesn't 'pause' and wait for the response. So then I thought I
could use SNDPGMMSG, specify a key variable, then use RCVMSG for an *INQ
type with that MSGKEY.
Anyone have any hints for this type of debugging interaction? Cross
to midrange and web since it has a MSG question as we as a PHP technique.list
Thanks!
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
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.