Success in running a JD Edwards DREAM writer CL program today.
Using the Samples/Toolkit/CLCommand.php as a template.
http://samson:10088/Samples/Toolkit/
New PHP Toolkit Demo Scripts
The new Toolkit technology is based on an open source XML transport
developed by IBM and Zend, which allows you to extend PHP code to access
IBM i resources. The Toolkit XML service
protocol is designed to work with "state full" RPG/CL programs (many
open database files and other system resources), so a developer won't
have to rewrite any programs just to get on the web.
Clicking on the script name will run the code and clicking on the
dsiplay code will display the PHP code. The scripts location is
/www/zendsvr/htdocs/Toolkit.
Run Display Library (DSPLIBL) command Display Code
Program Call with two parameters Display Code
Program Call with Data structure parameters Display Code
Service Program call that returns function value Display Code
Additional code samples
Work with Spoooled File entries Display Code
Work with Data Queue (keyed) Display Code
Work with User Space Display Code
Work with Objects Display Code
Work with Jobs Display Code
<pre>
This program runs following CL commands:
- CHGLIBL LIBL(QTEMP AMSOBJ JDFOBJ CLTSEC AMSCOM CANDTA QGPL CRMSAT)
- CALL PGM(AMSOBJ/J5501STAR3) PARM('P5501STAR' 'STAR0001' &PSALPH
&PSAC02 &PSAC11 &PSADD1 &PSADD2 &PSCTY1 &PSADDS &PSADDZ &PSPHO1 &PSPHO2
&PSCONT &PSPHO3 &PSAN8A)
</pre>
<?php
include_once 'authorization.php';
include_once 'ToolkitService.php';
try {
$obj = ToolkitService::getInstance($db, $user, $pass);
}
catch (Exception $e) {
echo $e->getMessage(), "\n";
exit();
}
$obj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user",
'debug'=>true,
'plug' => "iPLUG32K"));
$cmd = "CHGLIBL LIBL(QTEMP AMSOBJ JDFOBJ CLTSEC AMSCOM CANDTA QGPL
CRMSAT)";
$obj->CLCommand($cmd);
$cmd = "CALL PGM(AMSOBJ/J5501STAR3) PARM('Zend PHP Customer 1 with
very long name' 'AA' 'CEM' '123 Main St' ' ' 'Tulsa' 'OK' '74116'
'918' '8796036' 'ZendPHP' ' ' ' ')";
$obj->CLCommand($cmd);
echo "<pre>";
if(!$Rows )
echo $obj->getLastError();
else
var_dump($Rows);
echo "</pre>";
/* Do not use the disconnect() function for "state full" connection */
$obj->disconnect();
?>
As an Amazon Associate we earn from qualifying purchases.