The CLCommand Method

CL Command Execution Method

There are several methods to call a command:

  1. CLInteractiveCommand – Returns screen output from a command.

    1. $output = $obj->CLInteractiveCommand($Command);

  2. CLcommand – Returns only a boolean success flag from a command. Fastest way to run a command.

    1. $success = $obj->CLCommand($Command)

  3. ClCommandWithOutput – Returns output parameters from commands that have output parameters. Decimal parameters require (?N) rather than (?) in command string.

    1. $cmd = 'RTVJOBA JOB(?) USER(?) NBR(?) CURUSER(?) DFTCCSID(?N)';
      $output = $obj->CLCommandWithOutput($cmd);







Valid CL command string

Sample Code

This sample shows how to run the following CL commands:



Usage Example

include_once 'authorization.php';
include_once '../API/ToolkitService.php';

     try {
         $obj = ToolkitService::getInstance($db, $user, $pass);
     catch (Exception $e) {              
        echo  $e->getMessage(), "\n";

    $obj->setToolkitServiceParams(array('InternalKey'=>"/tmp/$user",                                         'debug'=>false,                                         'plug' => "iPLUG32K"));
    $cmd = "addlible ZENDSVR";
    echo "<pre>";  
    $Rows = $obj->CLInteractiveCommand("DSPLIBL");
    /*$Rows = $obj->CLInteractiveCommand("WRKSYSVAL OUTPUT(*PRINT)");*/
    if(!$Rows )
        echo $obj->getLastError();

    echo "</pre>";