LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 06-05-2008, 09: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 10:24 AM. Reason: Removed IP and Username/Passwords
 
Old 06-05-2008, 10:24 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,093

Rep: Reputation: 111Reputation: 111
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, 10:34 AM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,093

Rep: Reputation: 111Reputation: 111
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, 07: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, 11:46 AM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,093

Rep: Reputation: 111Reputation: 111
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, 08: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, 05:35 PM   #7
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,093

Rep: Reputation: 111Reputation: 111
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 09:58 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration