i5_libl using a library that contain § char

The place for general PHP questions and hints for PHP on IBM i
Post Reply
vaa03
Posts: 20
Joined: Sun Apr 04, 2010 11:57 pm

i5_libl using a library that contain § char

Post by vaa03 » Tue Sep 30, 2014 10:14 pm

Hi
i have a problem using a simple db2_connect specifing i5_libl param as follow:

$conn = db2_connect($db,$user,$pwd,array("i5_naming"=>DB2_I5_NAMING_ON, 'i5_libl'=>"MYLIB §YOURLIB"));

if i use a library containing § character the function will raise an error.
Any way to solve it? does anyone can try it?

Thanks!

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

Re: i5_libl using a library that contain § char

Post by erich_hieden » Thu Oct 02, 2014 7:51 am

Hello

Check ALL of your CCSID Settings. In CCSID 37 the § character is not allowed in object or library names. In CCSID 1141 (the one I'm using) it is instead of the @ character. I assume this is due to the switched hex positions.

Though I ever tried using § in program names (which definitely works) never in a library.

Best

vaa03
Posts: 20
Joined: Sun Apr 04, 2010 11:57 pm

Re: i5_libl using a library that contain § char

Post by vaa03 » Thu Oct 02, 2014 10:09 am

Hi Erich
thanks for your reply.

I've a couple of update on this:

CCSID CHECK
======================================================================
CCSID (ASCII) . . . . . : 1208
Language ID . . , , , , : C
DefaultFsCCSID. . . . . : 280
CGIJobCCSID . . . . . . : 280
System CCSID . . . . . .: 65535
User profile is 280


======================================================================
Changing library with XML Toolkit works properly:
$r1 = $toolkit->ClCommand("ADDLIBLE LIB(§ABC) POSITION(*LAST)","b");

======================================================================
Another tecnique that works properly is the following - that should be the same used by db2_ driver except for the fact that i don't specify the second parameters (cmd lenght)

if(!empty($libraries)){
$libraries = ' ABC §ABCDE FOO';
$sql = "call qsys2/qcmdexc('CHGLIBL LIBL($libraries)')";
$stmt = db2_exec($db2Connection, $sql);
if (!$stmt) die("Bad exec direct ($sql): ".db2_stmt_errormsg()."\n");
}
======================================================================

Thanks!

M.

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

Re: i5_libl using a library that contain § char

Post by erich_hieden » Fri Oct 03, 2014 5:45 am

Good morning

Running a QCCSID of 65535 is NEVER a good idea when trying to do PHP (see http://174.79.32.155/wiki/index.php/PHP/DB2CCSID). So please change this and try again.

Best

Post Reply