Perl on AS400

M

Michel

Can someone help me with this problem
I am using perl on as400 V5r1 with CCSID 00500, locale EN_BE_LOCALE
when I try this:

perl -e 'use DBI;'
Unrecognized character \112 at /usr/local/lib/perl5/5.00502/Carp.pm line 79.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.00502/DBI.pm line
137.
BEGIN failed--compilation aborted at -e line 1.

this is what I got.

Any help is welcome
 
J

James Willmore

On 15 Oct 2003 02:27:49 -0700
Can someone help me with this problem
I am using perl on as400 V5r1 with CCSID 00500, locale EN_BE_LOCALE
when I try this:

perl -e 'use DBI;'

Unrecognized character \112 at /usr/local/lib/perl5/5.00502/Carp.pm
line 79. BEGIN failed--compilation aborted at
/usr/local/lib/perl5/5.00502/DBI.pm line
137.

BEGIN failed--compilation aborted at -e line 1.


this is what I got.

Any help is welcome

If the AS400 is anything like the S390 in any way, you _may_ want to
check the translation table for the machine. And also make sure the
Perl binary was installed properly.

This is only a guess and _may_ be way off.

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
"The eleventh commandment was `Thou Shalt Compute' or `Thou Shalt
Not Compute' -- I forget which." -- Epigrams in Programming,
<ACM SIGPLAN Sept. 1982
 
M

Michel

James Willmore said:
If the AS400 is anything like the S390 in any way, you _may_ want to
check the translation table for the machine. And also make sure the
Perl binary was installed properly.
Thanks Jim, and you are right the problem state in the conversion
tables… When I use ‘qshell' with the CCSID 37 (US code page) perl
seems to work ! So I do not understand why it didn't work with CCSID
500 (French Belgium, Canada, Switzerland) !
Anyway I still have problems with the result of query.
Problems are with characters fields or varchar , date etc .. except
numeric field
I give a example :
1) in CCSID 37 the query (in direct) works
db2 'select * from mbr.junk '

JUNK1 JUNKTXT
----------------- --------------
1 Message un
26 Message 26
25 Message 25

3 RECORD(S) SELECTED.

Now with this little perl script
cat mbdb.pl
#! /usr/bin/perl
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;
$dbh = DBI->connect("dbi:DB2:DBBABY") or die;
$stmt = 'SELECT * FROM MBR.junk';
$cur = $dbh->prepare($stmt);
$cur->execute();
die "Prepare error: $DBI::err ... $DBI::errstr" if $DBI::err;
DBI::dump_results($cur);
$cur->finish();

And the result is:
1, undef
26, undef
25, undef
3 rows
So here am I, trying to resolve the 2 problems a) CCSID 500 and 2) Why
characters based fields are not be taken correctly by the constants
definition module.
Again many thanks to you.
 
J

James Willmore

On 20 Oct 2003 01:00:13 -0700
Thanks Jim, and you are right the problem state in the conversion
tables_ When I use _qshell' with the CCSID 37 (US code page) perl
seems to work ! So I do not understand why it didn't work with
CCSID 500 (French Belgium, Canada, Switzerland) !
Anyway I still have problems with the result of query.
Problems are with characters fields or varchar , date etc .. except
numeric field
I give a example :
1) in CCSID 37 the query (in direct) works

JUNK1 JUNKTXT
----------------- --------------
1 Message un
26 Message 26
25 Message 25

3 RECORD(S) SELECTED.

Now with this little perl script
#! /usr/bin/perl
use DBI;
use DBD::DB2::Constants;
use DBD::DB2;
$dbh = DBI->connect("dbi:DB2:DBBABY") or die;
$stmt = 'SELECT * FROM MBR.junk';
$cur = $dbh->prepare($stmt);
$cur->execute();
die "Prepare error: $DBI::err ... $DBI::errstr" if $DBI::err;
DBI::dump_results($cur);
$cur->finish();

And the result is:
1, undef
26, undef
25, undef
3 rows
So here am I, trying to resolve the 2 problems a) CCSID 500 and 2)
Why characters based fields are not be taken correctly by the
constants definition module.
Again many thanks to you.

I'm at a loss. Basically because I have zero experience with an AS400
:-( The code you published here is correct - it appears that there's
a disconnect between the DBD and DB2.

You _may_ consider installing, by hand (not through CPAN or a package)
the DBD::DB2 module. Maybe there's something funky there.

Sorry I can't be of more help :-(

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Down with categorical imperative!
 
J

Joe Halbrook

I'd love to know what is required to install Perl (and Perl
modules) on an AS400. I know you have to manipulate the HTTP Server,
as well. I've used Perl on UNIX/Linux, but not on the AS400. I've
been developing on the AS400 (in RPG) since it hit the market.

Joe Halbrook
 
M

Michel

I'd love to know what is required to install Perl (and Perl
modules) on an AS400. I know you have to manipulate the HTTP Server,
as well. I've used Perl on UNIX/Linux, but not on the AS400. I've
been developing on the AS400 (in RPG) since it hit the market.

Joe Halbrook

Hi Joe,

Have a look at:
http://www.redbooks.ibm.com/tstudio/workshop/tiptools/perl.htm
From there you will have all the information needed.
And please don't miss the Readme ;-)

Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top