Open-source Languages & Tools for z/OS

 View Only
  • 1.  Perl module DBI install

    Posted 09-21-2016 07:17

    trying to get perl ready to access DB2 for z/OS. z/OS has no internet connection. What do I need to do to enable perl to access DB2 for z/OS? My apologies for asking such a “starting from scratch” question. I simply could not find anything that worked for me so far.



  • 2.  RE: Perl module DBI install

    Posted 09-21-2016 09:26

    Probably you have to install DRI module:
    http://search.cpan.org/dist/Net-DRI/lib/Net/DRI.pm (Net::DRI - Interface to Domain Name Registries/Registrars/Resellers).

    Regards,
    Andrey



  • 3.  RE: Perl module DBI install

    Posted 09-21-2016 10:10

    Interesting. How does DRI (Domain Registry Interface) relate to the DBI (Database Interface) module. Please advise.



  • 4.  RE: Perl module DBI install

    Posted 09-22-2016 09:30

    Sorry, looks like I didn’t understand you correctly.

    1. You wrote: z/OS has no internet connection.
      Net::DRI is a Perl library to access services offered by domain name providers, such as registries or registrars. DRI stands for Domain Registration Interface and it aims to be for domain name registries/registrars/resellers what DBI is for databases: an abstraction over multiple providers, with multiple policies, transports and protocols all used through a uniform API.
    2. If you just want access to DB2 you have to read http://search.cpan.org/~timb/DBI-1.636/DBI.pm
    3. If you have any errors while DB2 access, please show code and errors messages to us.

    Regards,
    Andrey



  • 5.  RE: Perl module DBI install

    Posted 09-22-2016 11:05

    Hello Andrey,
    many thanks for that information.
    If I try to use the cpan utility to install DBI I get stuck because the z/OS lpar has NO internet connectivity and cpan tries to fetch DBI from the internet. How can I install DBI without internet connectivity? Any glue?
    Regards, Josef



  • 6.  RE: Perl module DBI install

    Posted 10-19-2016 10:48

    Hello datajoe
    I have received a protocol from Rocket Software on how to download the DBI module and step by step, follow an installation process. Unfortunately the Makefile.PL script gives an error by not finding the DBI
    "Can’t locate DBI/DBD.pm in @INC (you may need to install the DBI::DBD module) (@INC contains: /" and then i get a list of the file locations on the @INC array. I have added the location of the DBD.pm to my LIBPATH ( and PATH for that matter), but still to no avail.

    Anyone help me with setting the @INC array before i execute “perl Makefile.PL” ?



  • 7.  RE: Perl module DBI install

    Posted 10-19-2016 10:48

    By the way, I am no perl guru.



  • 8.  RE: Perl module DBI install

    Posted 10-20-2016 09:13

    Hi,
    I’m afraid you have problems because of encoding. I’m busy with script that will convert data correctly. I will post all commands with comments soon.

    Thanks,
    Andrey



  • 9.  RE: Perl module DBI install

    Posted 10-20-2016 09:43

    Thanks Andrey you can post it here if possible



  • 10.  RE: Perl module DBI install

    Posted 10-20-2016 10:13

    I hope it will help you.

    1. Download:
      curl -kO https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.636.tar.gz

    2. Open archive:
      gzip -d DBI-1.636.tar.gz
      tar -xfvo DBI-1.636.tar

    3. If data isn’t readable, use script “convert.sh” to convert data from ASCII to EBCDIC:
      convert.sh:

      #!/bin/bash

      DIR='DBI-1.636’
      FROM='UTF-8’
      TO='IBM-1047’
      ICONV=“iconv -f $FROM -t $TO”

      find $DIR/ -type f -name “*” | while read fn; do
      echo $fn
      cp ${fn} ${fn}.bak
      $ICONV < ${fn}.bak > ${fn}
      rm ${fn}.bak
      done

    4. Change directory:
      cd DBI-1.636

    5. Run makefile:
      perl Makefile.Pl

    6. Use make to install it:
      make
      make test
      make install

    If you will get an error, please show whole message,

    Regards,
    Andrey



  • 11.  RE: Perl module DBI install

    Posted 11-02-2017 11:42

    Maybe something from the best Perl tutorials & books can help.