Antwort: Re: Access into MVS DB2 using DBI or ???

From: Manfred Beilfuss (Manfred.Beilfuss_at_dvag.com)
Date: 03/31/04


To: "Hardy Merrill" <HMerrill@dhcr.state.ny.us>
Date: Wed, 31 Mar 2004 15:17:39 +0200

Hi,

as I already mentioned this morning, you don't need anything special in
perl to access a DB2 on a mainframe nor on any other operating system.

All You need is dbi and depending on how you like it e.g. dbd::db2 or
dbd:odbc !

On the machine where you run your perl script you need the db2-connection
properly configured to your target-db2-system.

To show you the basics I just quote from the dbd::db2 standard example :

> #!/usr/local/bin/perl
>
> use DBI;
> use DBD::DB2::Constants;
> use DBD::DB2 qw($attrib_int $attrib_char $attrib_float
> $attrib_date $attrib_ts);
>
> # an extraneous example of the syntax for creating a new
> # attribute type
> $attrib_dec = { %$attrib_int,
> 'db2_type' => SQL_DECIMAL,
> 'SCALE' => 2,
> 'PRECISION' => 31 };
>
> #$DBI::dbi_debug=9; # increase the debug output
>
>
> # Open a connection and set LongReadLen to maximum size of column

Here you have to add the cataloged db2-alias e.g. D2HOST for your mainframe

> $dbh = DBI->connect("dbi:DB2:D2HOST","","", { LongReadLen => 102400 } );
> if (!defined($dbh)) { exit; }

OR e.g. "D2NT" for your DB2-UDB on a NT-Server

> $dbh = DBI->connect("dbi:DB2:D2NT","","", { LongReadLen => 102400 } );
> if (!defined($dbh)) { exit; }

Everything else remains the same! The only thing are possible
sql-syntax-differences on different db2-versions.

Mit freundlichen Gruessen / Best regards

Manfred Beilfuss

Deutsche Vermögensberatung AG
IT_Systemmanagement , DBA
Münchenerstr. 1
60329 Frankfurt
Tel.: +49 (69) 2384 - 639
Fax: +49 (69) 2384 - 329
Mailto:Manfred.Beilfuss@dvag.com

                                                                                                                 
                    "Hardy Merrill"
                    <HMerrill@dhcr.st An: <David.Wagner@freight.fedex.com>, <dbi-users@perl.org>
                    ate.ny.us> Kopie:
                                             Thema: Re: Access into MVS DB2 using DBI or ???
                    31.03.2004 14:55
                                                                                                                 
                                                                                                                 

You normally need DBI *and* the appropriate DBD:: module for your
particular database - in this case probably DBD::DB2. I have no
experience connecting to MVS DB2 so I can't offer any more help here.

Hardy Merrill

>>> "Wagner, David --- Senior Programmer Analyst --- WGO"
<David.Wagner@freight.fedex.com> 03/30/04 06:34PM >>>
           Uuncertain where to start or really what to use to try and see
if I can do this? I searched under Activestate and found a large group
of DBI modules.

           Do I just need DBI? Or are there other modules which I work with
DBI?

           I am on XP Professional running service pack 1 and Perl AS 5.8.2
build 808.

      Any questions and/or problems, please let me know.

      Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224

**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************



Relevant Pages

  • DBD DBI Software levels
    ... too clear on the software dependencies of DBD and DBI. ... Are DBD and DBI dependent on the level of perl used to "make" them? ... Are dbd and dbi dependent on the level of the DB2 Application Development ...
    (perl.dbi.users)
  • RE: Antwort: Re: Access into MVS DB2 using DBI or ???
    ... > perl to access a DB2 on a mainframe nor on any other operating system. ... I have done nothing with DB2 on my XP machine. ... > of DBI modules. ...
    (perl.dbi.users)
  • RE: DBD::DB2 Error
    ... I finally got past the license issue. ... It looks as though the DB2 9 I ... Perl Version = 5.008008 ... DBI Version = 1.53 ...
    (perl.dbi.users)
  • Re: Perl 6 DBI API ideas
    ... Though I didn't raise my hand when you asked for people to contribute to a DBI module for Perl 6, I've had some ideas that I thought about sharing. ... I would also love to see some standardization on the driver names ("mysql" when it's normally written ... DBI is supposed to be query language agnostic, even if SQL is the most commonly used group of languages, and if a user can declare this explicitly, it saves the driver from having to guess what they were given, which might be ambiguous. ...
    (perl.dbi.users)
  • Problem of DBI build
    ... I installed Oracle Application Server 4.0.8.2 included perl module. ... I need to installe DBI and DBD::Oracle module. ... You can install them any time after installing the DBI. ... line 318: error 1705: Function prototypes are an ANSI feature. ...
    (perl.dbi.users)