Perl on AS400

Discussion in 'Perl Misc' started by Michel, Oct 15, 2003.

  1. Michel

    Michel Guest

    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
     
    Michel, Oct 15, 2003
    #1
    1. Advertising

  2. On 15 Oct 2003 02:27:49 -0700
    (Michel) wrote:

    > 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
     
    James Willmore, Oct 15, 2003
    #2
    1. Advertising

  3. Michel

    Michel Guest

    James Willmore <> wrote in message news:<>...
    >
    > 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:
    > mbdb.pl

    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.
     
    Michel, Oct 20, 2003
    #3
  4. On 20 Oct 2003 01:00:13 -0700
    (Michel) wrote:

    > James Willmore <> wrote in message
    > news:<>...
    > >
    > > 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:
    > > mbdb.pl

    > 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!
     
    James Willmore, Oct 20, 2003
    #4
  5. Michel

    Joe Halbrook Guest

    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
     
    Joe Halbrook, Oct 21, 2003
    #5
  6. Michel

    Michel Guest

    (Joe Halbrook) wrote in message news:<>...
    > 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
     
    Michel, Oct 22, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RC5TYXJhdmFuYW4=?=

    DB_E_BADPROPERTYVALUE error when connecting to AS400 db2 udb

    =?Utf-8?B?RC5TYXJhdmFuYW4=?=, Jun 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    488
    =?Utf-8?B?RC5TYXJhdmFuYW4=?=
    Jun 18, 2004
  2. Manuel Arroba
    Replies:
    0
    Views:
    2,070
    Manuel Arroba
    Jun 28, 2004
  3. Cor Ligthert

    Re: AS400 And ADOx

    Cor Ligthert, Sep 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    628
    Cor Ligthert
    Sep 14, 2004
  4. kh
    Replies:
    2
    Views:
    17,525
    bruce barker
    Nov 23, 2004
  5. fel

    AS400 v4r2 Perl

    fel, Oct 11, 2007, in forum: Perl Misc
    Replies:
    0
    Views:
    82
Loading...

Share This Page