I am trying to submit an FTP within a PERL script within a USS (UNIX System Services) environment. Each time I run the script I get an error “Can't ftp to my IP: EDC5049I The specified file name could not be located.”
I am able to run FTP using the command line and also in a CSHELL script. I am positive the IP address is correct, because it is the IP address of the Mainframe I am trying to ftp to.
My code:
#libraries for FTP and time strings
#!/usr/SHRWARE/perl/bin -w
use diagnostics;
require 5.8.7;
use sigtrap;
use Net::FTP;
use Socket;
use POSIX qw(strftime);
# Set Variables
my $ftp = '';
# Set Local Directory
my $host = "168.230.158.11";
#y $host = "ibmdevl.fairisaac.com";
my $dir = "/u/fia/FIA1TPL/perl";
# Set up the file to get
my $file = "test_sub.jcl";
print "FTP = ";
print $ftp; print "\n";
print "Host = ";
print $host; print "\n";
print "Dir = ";
print $dir; print "\n";
print "File = ";
print $file; print "\n";
# Connect to Fair Isaac IBM
$ftp = Net::FTP->new("168.230.158.11",Timeout=>360) or $newerr=1;
push @ERRORS, "Can't ftp to $host: $!\n" if $newerr;
myerr() if $newerr;
print "Exec FTP =";
print "Connected.\n";
sub myerr {
print "Error: \n";
print @ERRORS;
exit 0;
}
My output is:
FTP = Host = 168.230.158.11
Dir = /u/fia/FIA1TPL/perl
File = test_sub.jcl
Error: Can't ftp to 168.230.158.11: EDC5049I The specified file name could not be located.
I would appreciate any help.
I am able to run FTP using the command line and also in a CSHELL script. I am positive the IP address is correct, because it is the IP address of the Mainframe I am trying to ftp to.
My code:
#libraries for FTP and time strings
#!/usr/SHRWARE/perl/bin -w
use diagnostics;
require 5.8.7;
use sigtrap;
use Net::FTP;
use Socket;
use POSIX qw(strftime);
# Set Variables
my $ftp = '';
# Set Local Directory
my $host = "168.230.158.11";
#y $host = "ibmdevl.fairisaac.com";
my $dir = "/u/fia/FIA1TPL/perl";
# Set up the file to get
my $file = "test_sub.jcl";
print "FTP = ";
print $ftp; print "\n";
print "Host = ";
print $host; print "\n";
print "Dir = ";
print $dir; print "\n";
print "File = ";
print $file; print "\n";
# Connect to Fair Isaac IBM
$ftp = Net::FTP->new("168.230.158.11",Timeout=>360) or $newerr=1;
push @ERRORS, "Can't ftp to $host: $!\n" if $newerr;
myerr() if $newerr;
print "Exec FTP =";
print "Connected.\n";
sub myerr {
print "Error: \n";
print @ERRORS;
exit 0;
}
My output is:
FTP = Host = 168.230.158.11
Dir = /u/fia/FIA1TPL/perl
File = test_sub.jcl
Error: Can't ftp to 168.230.158.11: EDC5049I The specified file name could not be located.
I would appreciate any help.