Zendsvr 5.6 - cannot call cl pgm

General discussion on Zend Server for IBM System i
Post Reply
hl_soong
Posts: 5
Joined: Mon Jun 11, 2012 1:28 pm

Zendsvr 5.6 - cannot call cl pgm

Post by hl_soong » Mon Jun 11, 2012 1:40 pm

Hi,
Newly installed the Zendsvr 5.6 for o/s r710. Move over my old pgm from lower version of Zendsvr but the CL pgm cannot run.
I have added the new toolkit and add hotfix.

The code was like this on the old version of zendsvr:-

$conn = i5_connect($i5_server_ip, $i5_uname, $i5_pass);

$CLPGM = ("MOD2073/WORLCL");

if (i5_command("CALL",array("PGM" => "$CLPGM "),array(),$conn)) {

With the new version, I changed it to like this:-
require_once('CW/cw.php');

if (!defined('DATABASE'))
define('DATABASE', "localhost");
if (!defined('USER'))
define('USER', "AS400");
if (!defined('PASSWORD'))
define('PASSWORD','only4ftp');

$conn = i5_connect(DATABASE, USER, PASSWORD); --> No issue in the connection

$cmdString = "CALL PGM(MOD2073/WORLCL)";

$success = $conn->CLCommand($cmdString);
if($success) {
echo "Success";
} Else {
echo "Error : " . $conn->getErrorMsg();

}

Can someone help?

erich_hieden
Posts: 393
Joined: Tue Jul 07, 2009 9:01 am

Re: Zendsvr 5.6 - cannot call cl pgm

Post by erich_hieden » Mon Jun 11, 2012 3:54 pm

Hi

Have you tried updating the toolkit and xmlservice? Follo the instructions in this topic: viewtopic.php?f=113&t=48668

hl_soong
Posts: 5
Joined: Mon Jun 11, 2012 1:28 pm

Re: Zendsvr 5.6 - cannot call cl pgm

Post by hl_soong » Mon Jun 11, 2012 7:13 pm

Hi,
Thanks. I did update the toolkit, not the xmlservice since I was solely using only php calling CL pgm, not RPG.
I will try update the xml service.

I did tried this and it works for one pgm, not another:-

require_once('CW/cw.php');

if (!defined('DATABASE'))
define('DATABASE', "localhost");
if (!defined('USER'))
define('USER', "AS400");
if (!defined('PASSWORD'))
define('PASSWORD','only4ftp');

$conn = i5_connect(DATABASE, USER, PASSWORD);
$start=$_POST["start_date"];
$num=$_POST["title_no"];

$description = array(
array(
"NAME"=>"PARM",
"IO"=>I5_IN,
"Type"=>I5_TYPE_CHAR,
"Length"=>"10"
),
);

$pgm = i5_program_prepare("MKTSALE/TOP", $description);


Previously, with the earlier version, if pgm failed, there is an error message at Zendsvr subsystem but now where do I see the error?

aseiden
Posts: 875
Joined: Thu Apr 09, 2009 5:45 pm

Re: Zendsvr 5.6 - cannot call cl pgm

Post by aseiden » Tue Jun 12, 2012 4:36 am

Hi,

I see you used i5_program_prepare, but you must then use i5_program_call($pgm, $paramsIn, $paramsOut);

Did you use i5_program_call?

Alan

Post Reply