On April 5, 2004 5:00 pm, Wagner, David --- Senior Programmer Analyst --- WGO 
wrote:
> [EMAIL PROTECTED] wrote:
> > 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.
>
>       Everything I have received says it should be easy, but I can not get
> anyhting but an error. I have tried all types of variations and no matter
> what I do, it says either argument error or invalid table name.

I presume you can connect from the db2 commandline processor (db2.exe)?
If so, what is the exact connect command you give it?  It should be
something like:

  CONNECT TO db_name USER username USING password

(feel free to not give the password ;->)

Assuming this, then you would need to connect via perl using:

my $dbh = DBI->connect('dbi:DB2:db_name', 'username', 'password');

My guess would be that you haven't cataloged the MVS db locally.  Note
that to do this, you either need to have DB2 Connect Personal Edition,
DB2 Connect Enterprise Edition, or DB2 UDB Enterprise Server Edition
installed locally, or you must have a gateway set up with DB2 Connect
Enterprise Edition or DB2 UDB Enterprise Server Edition installed.  For
help on this aspect, I would recommend comp.databases.ibm-db2 as it's
not really a DBI issue.

>       Now I can get the datasources or the driver info.
>
>       So I have the following for:
> Driver Info:
> DB2
> ODBC
>
> Data sources:
> dbi:DB2:AFDSNP
> dbi:DB2:AFDSNT
>
> My file name is 'PS_FXF_BU_XLAT'.
>
>       Given the above, what would be the right commands to connect:
> I have done nothing with DB2 on my XP machine. IN the statement below,
>
> > Here you have to add the cataloged db2-alias e.g. D2HOST for your
> > mainframe
>
>       which does not say anything to me.

Just another way of saying the above ;-)

>       I admit being a newbie to the DBI side, but using Perl for a number years.
>  I have looked at the doc and tried a number of things, but I must be
> missing the most basic of things.
>
>       Would there be another list which could help? I am at my wits end ( which
> may not even be much of an end), but I am.
>
>       Thanks for any insight or EXAMPLES of working Windows to MVS scripts.  Not
> trying to update, but just want to select and display.

Once you have the CLP working, then we can work on the DBI stuff, but I
suspect that the DBI stuff will be trivial once the CLP works.  It
always is for me!


Reply via email to