Fetches output variable further to a sent i5_cmd command.
string i5_ cmdget (string variable_name [, resource connection])
Parameters
variable_name |
variable to read name |
connection |
Current connection ID |
Return
Value of the variable passed in parameter.
Possible errors:
I5_ERR_MEMALLOC |
3 |
Not enough memory |
I5_ERR_PHP_HDLCONN |
257 |
This resource has no connection active. |
I5_ERR_PHP_RESOURCE_BAD |
261 |
No resource found. |
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
I5_ERR_PHP_NBPARAM_BAD |
263 |
Wrong parameter count |
Detail
i5_cmdget function is always used after i5_cmd with output parameters.
Those parameters can only be fetched with their names. Type is always string.
Example
Example 1: RTVJOBA command.
/* Connection to AS400 */
$conn = i5_connect("MY_AS", "USER", "PASSWORD");
/* Executes the command on AS400 */
$ret = i5_cmd("user=char(10);usrlib=char(275);syslib=char(165);curl=char(10);rtvjoba user(&user) usrlibl(&usrlib) syslibl(&syslib) curlib(&curl)");
if ($ret)
{
$RC = i5_cmdget("RC");
if ($RC == 0)
{
$util = i5_cmdget("user", $conn);
$bibl = i5_cmdget("usrlib", $conn);
$sysb = i5_cmdget("syslib", $conn);
$curl = i5_cmdget("curl", $conn);
print "User: ". $util."<br>" ;
print "User libraries list: ". $bibl . "<br>" ;
print "System libraries list: ". $sysb."<br>" ;
print "Current library: " . $curl . "<br>" ;
}
else
{
print_r("i5_cmdget error : ".i5_errormsg().'<br/>');
}
}
else
{
print_r("i5_cmd error : ".i5_errormsg().'<br/>');
}
See also