LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-05-2008, 08:22 AM   #1
ndesai
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
error while using perl:dbi to connect to access db2 data on mainframes


i am facing error while accesing db2 data using perl dbi on linux.
it gives a error

Cannot establish an ftp connection to host xxx.xxx.xxx.xxx at port 446. Error received: Bad file descriptor

the program i am executing is first.pl


use warnings;
use strict;
use DBI;
# All the queries will be routed to the DB2 subsystem DB2P
#
# jsmith/123456 must be a valid mainframe account able to query the tables of DB2P
#
my ($hostname,$port,$ssid) = ('xxx.xxx.xxx.xxx',446,'SHEF2282');
my ($username,$password) = ('username','password');
my $dbh = DBI->connect("dbi:MVS_FTPSQL:hostname=$hostname;port=$port;ssid=$ssid",$username,$password)
or die "Can't connect to database: $DBI::errstr\n";
#Prepares the query
my $sth = $dbh->prepare("SELECT * FROM EMPLOYE");
#Executes it
$sth->execute();
print "\tQuery results:\n================================================\n";

while ( my @row = $sth->fetchrow_array( ) ) {
print "@row\n";
}
warn "Problem in retrieving results", $sth->errstr( ), "\n"
if $sth->err( );
$sth->finish();
$dbh->disconnect();
~
~

Last edited by trickykid; 06-05-2008 at 09:24 AM. Reason: Removed IP and Username/Passwords
 
Old 06-05-2008, 09:24 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Moderator note: I removed the IP Address and username/password from your post. It's wise not to give such details when asking for help.
 
Old 06-05-2008, 09:34 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
As for the problem, If your connecting to DB2, why is it complaining about FTP access? A bad file descriptor problem can be numerous things, most of the time it's on the OS level or filesystem level.
 
Old 06-06-2008, 06:37 AM   #4
ndesai
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Original Poster
Rep: Reputation: 0
thanks acctually i am new to this so did't knew not to mention those info.

regarding the problem can u plz tell me anyother way to connect to db2 on mainframes using perl on linux.

thanks.
 
Old 06-06-2008, 10:46 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by ndesai View Post
thanks acctually i am new to this so did't knew not to mention those info.

regarding the problem can u plz tell me anyother way to connect to db2 on mainframes using perl on linux.

thanks.
I would imagine perl::dbi is the best way that you are using, unless you want to write your own perl code to connect.
 
Old 06-11-2008, 07:28 AM   #6
ndesai
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Original Poster
Rep: Reputation: 0
HELP : access db2 on mainframes using perl

how to access db2 on mainframes using perl on linux .
plz help i tried doing it using DBD-MVS_FTPSQL-0.38.14
but not able to do it as its giving ftp connection error
 
Old 06-12-2008, 04:35 PM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by ndesai View Post
how to access db2 on mainframes using perl on linux .
plz help i tried doing it using DBD-MVS_FTPSQL-0.38.14
but not able to do it as its giving ftp connection error
Please do not start the same discussion more than once. I've merged this new thread with your existing thread you've already started.
 
  


Reply

Tags
linux, perl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl DBI Queries baddah Programming 1 05-13-2008 05:56 PM
Error using DBI with Perl bostonantifan Ubuntu 0 11-11-2007 01:47 PM
Mysql reading via Perl DBI ivanatora Programming 2 03-21-2007 04:03 AM
perl | DBI->connect | RHEL AS 3 kaN5300 Linux - Enterprise 6 09-14-2004 08:15 AM
connecting from Linux to MS SQL using perl DBI->connect Aniket Linux - Software 0 08-08-2002 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration