Hi! I am trying to ftp a file to the mainframe using perl and once i have ftp the file i would then like to kick off a job or jcl. When trying to kicking off the jcl or job i would get an error message of 'unable to close datastream' am i missing something in particular?
use Net::FTP;
my $ftp;
$ftp = Net::FTP->new("mainframe.com") || ((print LOG "$now->ERROR:FTP CONNECT TO MF FAILED\n"), return(1));
$ftp->login("userid", "password") || ((print LOG "$now->ERROR:FTP LOGIN TO MF FAILED\n"), return (1));
$ftp->site ("UNIT=PRODB") || ((print LOG "$now->ERROR:FTP SITE PRODB FAILED\n"), return (1));
$ftp->site ($recform) || ((print LOG "$now->ERROR:FTP SITE REC FORM FAILED\n"), return (1));
$ftp->site ($reclen) || ((print LOG "$now->ERROR:FTP SITE REC LENGTH FAILED\n"), return (1));
$ftp ->put($filename, $mainframe_filename) || ((print LOG "$now->ERROR:FTP PUT TO MF FAILED\n"), return (1));
$ftp->site ("filetype=jes") || ((print LOG "$now->ERROR:FTP SITE FILETYPE=JES FAILED\n"), return (1));
$ftp->get($jobname) || ((print LOG "$now->ERROR:FTP GET JOBNAME FAILED\n"), return (1));
use Net::FTP;
my $ftp;
$ftp = Net::FTP->new("mainframe.com") || ((print LOG "$now->ERROR:FTP CONNECT TO MF FAILED\n"), return(1));
$ftp->login("userid", "password") || ((print LOG "$now->ERROR:FTP LOGIN TO MF FAILED\n"), return (1));
$ftp->site ("UNIT=PRODB") || ((print LOG "$now->ERROR:FTP SITE PRODB FAILED\n"), return (1));
$ftp->site ($recform) || ((print LOG "$now->ERROR:FTP SITE REC FORM FAILED\n"), return (1));
$ftp->site ($reclen) || ((print LOG "$now->ERROR:FTP SITE REC LENGTH FAILED\n"), return (1));
$ftp ->put($filename, $mainframe_filename) || ((print LOG "$now->ERROR:FTP PUT TO MF FAILED\n"), return (1));
$ftp->site ("filetype=jes") || ((print LOG "$now->ERROR:FTP SITE FILETYPE=JES FAILED\n"), return (1));
$ftp->get($jobname) || ((print LOG "$now->ERROR:FTP GET JOBNAME FAILED\n"), return (1));