You are currently viewing Zend Server 5.x documentation. Click here to view the latest Zend Server online documentation.
You are here: API Reference Guide > PHP XMLSERVICE Toolkit > Toolkit Service Class > The PGMCall Method

The PGMCall Method

Program Call Method

The program call method allows calling program (*PGM) or service program (*SRVPGM).

PgmCall($Program, $Library, $Parameters, $Returnvalue, $Function)

 

Arguments

Value

Description

$Program

  •  Program name
  • *OFF
  • *NONE

Program name to be called

$Library

Library name

Library where the program is located

$Parameters

See parameters section

Program  parameters

$Returnvalue

 

Program return value

$Function

Function name

Service program function name

Sample Code

This sample shows how to run an RPG program that has the following parameters:

Usage Example

<?php
  
include_once 'authorization.php';
include_once '../API/ToolkitService.php';
include_once 'helpshow.php';
$extension='ibm_db2';  
try {
    $ToolkitServiceObj = ToolkitService::getInstance($db, $user, $pass, $extension);
    }
    catch (Exception $e)
    {              
        echo  $e->getMessage(), "\n";
        exit();
    }
   
$ToolkitServiceObj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user"));
$code = ‘1’;;
$desc = ' ';
     
$param[] = $ToolkitServiceObj->AddParameterChar('both', 10,'InventoryCode', 'code',
$code);
$param[] = $ToolkitServiceObj->AddParameterChar('both', 10,'Description', 'desc',
$desc);
$result = $ToolkitServiceObj->PgmCall("COMMONPGM", "ZENDSVR", $param, null, null);
if($result){
  showTable( $result['io_param']);
}
else
    echo "Execution failed.";
     
/* Do not use the disconnect() function for "state full" connection */
$ToolkitServiceObj->disconnect();
?>

 

 

 

Related Links

Related Links:

Toolkit Service Class

 

 

 

© 1999-2013 Zend Technologies, Ltd. All rights reserved.