Created
October 8, 2014 13:11
-
-
Save chukShirley/f67f1b56f78036ee08cf to your computer and use it in GitHub Desktop.
Using PHP Toolkit for IBM i to call CL program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate toolkit object | |
try{ | |
$ToolkitServiceObj = ToolkitService::getInstance($db, $namingMode); | |
} | |
catch (Exception $e) { | |
echo $e->getMessage(), "\n"; | |
exit(); | |
} | |
$ToolkitServiceObj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user", | |
'debug'=>true, | |
'plug' => "iPLUG32K")); | |
// Add parameters | |
$param[] = $ToolkitServiceObj->AddParameterChar('both', 1, 'yard', 'yard', $yard); | |
$param[] = $ToolkitServiceObj->AddParameterPackDec('both',9,0,'SRN','SRN',$srn); | |
$param[] = $ToolkitServiceObj->AddParameterChar('both', 10, 'outq', 'outq', $purch_outq); | |
// Call the program | |
$result = $ToolkitServiceObj->PgmCall("SC0003CL", "SSC", $param, null, null); | |
if($result){ | |
// Yay! The CL program returned a result! Do other stuff here... | |
} else { | |
// Boo! The CL program didn't return a result. Error handling goes here... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment