Opens a Program or Procedure using a PCML description, and prepares it to be run.
|
resource i5_program_prepare_PCML ( |
array description |
The program information file (in PCML format) can be created by compiling the RPG
program.
Example:
CRTBNDRPG PGM(EACDEMO/TESTSTRUC) SRCFILE(EACDEMO/QRPGLESRC)
SRCMBR(TESTSTRUC) PGMINFO(*PCML)
INFOSTMF('/www/zendcore/htdocs/teststruc.pcml')
The PCML file will contain the program parameters info. There are two ways you can assign the program parameters to i5-program_prepare_PCML description:
- Copy the content of PCML file to you PHP script and assign the i5_program_prepare_PCML description array to the PCML content. See PCML example in PCML Example 1
- Assign i5_program_prepare description array to the PCML file located in the same PHP program directory. See PCML example in figure 2
|
description |
PCML file's program and parameters information. |
|
Program_name |
Program name is usually embedded inside the PCML file. Program name is in the form: LIBRARY/NAME |
|
connection |
Result of i5_connect |
Returns:
Resource if open succeeded, false if open failed.
|
I5_ERR_DESC_WRONG_DATAOP |
41 |
Wrong operation on a data field of a description |
|
I5_ERR_PARSEXML |
42 |
Internal error; please contact Aura Equipement; error number 42 |
|
I5_ERR_PHP_OPTIONSTYPE |
259 |
The type of " I5_OPTIONS_ALIAS" option must be x and not x |
|
I5_ERR_PHP_OPTIONSNUMBER |
260 |
Option number -1 is unknown. |
|
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
|
I5_ERR_PHP_NO_DS_VALUE |
307 |
You cannot set a value for 'Data Structure' x. |
Example PCML :
$description = "<pcml version=\"4.0\">
<!-- RPG module: TESTSTRUC -->
<!-- created: 2006-10-12-11.46.56 -->
<!-- source: EACDEMO/QRPGLESRC(TESTSTRUC) -->
<!-- 5 -->
<struct name=\"S2\">
<data name=\"ZOND2\" type=\"zoned\" length=\"10\" precision=\"5\"
usage=\"inherit\" />
<data name=\"PACK2\" type=\"packed\" length=\"19\" precision=\"5\"
usage=\"inherit\" />
<data name=\"PACK3\" type=\"packed\" length=\"19\" precision=\"5\"
usage=\"inherit\" />
<data name=\"ALPH2\" type=\"char\" length=\"20\" usage=\"inherit\" />
</struct>
<!-- 1 -->
<struct name=\"S1\">
<data name=\"ZOND\" type=\"zoned\" length=\"10\" precision=\"5\"
usage=\"inherit\" />
<data name=\"PACK1\" type=\"packed\" length=\"19\" precision=\"5\"
usage=\"inherit\" />
<data name=\"ALPH1\" type=\"char\" length=\"10\" usage=\"inherit\" />
</struct>
<program name=\"TESTSTRUC\" path=\"/QSYS.LIB/EACDEMO.LIB/TESTSTRUC.PGM\">
<data name=\"CODE\" type=\"char\" length=\"10\" usage=\"output\" />
<data name=\"S1\" type=\"struct\" struct=\"S1\" usage=\"inputoutput\" />
<data name=\"S2\" type=\"struct\" struct=\"S2\" usage=\"inputoutput\" />
<data name=\"PACK\" type=\"packed\" length=\"1\" precision=\"1\"
usage=\"output\" />
<data name=\"CH10\" type=\"char\" length=\"19\" usage=\"output\" />
<data name=\"CH11\" type=\"char\" length=\"20\" usage=\"output\" />
<data name=\"CH12\" type=\"char\" length=\"29\" usage=\"output\" />
<data name=\"CH13\" type=\"char\" length=\"33\" usage=\"output\" />
</program>
</pcml>
";
Exemple 2:
($description = file_get_contents("/www/zendcore/htdocs/teststruc.pcml"))
or trigger_error("Error while opening PCML file", E_USER_ERROR);