I'm trying to take new ADB and CAS records from the adb and cas tables and write them to a file so that these files get FTPed to the appropriate location,
But it gives me this error message / FTP error.CAS file ". &cas_GetFilename. "not FTPed: Please any suggestion as to fixing this error will be greatly appreciated. See script below!
#Revisions: # # use strict; use NET::SMTP; use Net::FTP; use DBI; use Date::Manip; $ENV{'TZ'} = "EDT"; require "../reformat"; #initialization my $datewritten = UnixDate('today','%m/%d/%Y %H:%M'); my $g_datasource; my (%coninf); &readInfo; my $g_testing=0; if( (scalar @ARGV > 0 and $ARGV[0] eq "test") or not defined $coninf{n +ihits}{dsn} or $coninf{nihits}{dsn} =~ /TEST/i ){ $g_testing=1; } my $today = UnixDate("today","%y%m%d"); open(HI,">>fintrans$today.txt") or &handle_it("Could not open fintrans +$today.txt"); if( $g_testing == 1 ){ print "Testing mode is ON\n"; print HI "Testing mode is ON\n"; } $g_datasource = 'DBI:ODBC:'. $coninf{nihits}{dsn}; my $g_login = $coninf{nihits}{uid}; my $g_pwd = $coninf{nihits}{pwd}; my ($dbh,$sth,$casfile,$adbfile,$records,%ic_conv,$ret); my $g_existingfile = 'casnihit'; #DB connect $dbh = DBI->connect($g_datasource, $g_login, $g_pwd) or &handle_it("Co +uld not connect to the DB"); $dbh->{AutoCommit} = 0; print "Connecting to DSN ", $coninf{nihits}{dsn}, "\n"; print HI "Connecting to DSN ", $coninf{nihits}{dsn}, "\n"; my $fulldate = UnixDate("today", "%m/%d/%Y %H:%M"); print "\nProcess started at $fulldate\n"; print HI "\nProcess started at $fulldate\n"; #if today is a holiday, exit the process my $hol = &is_today_a_holiday; if( $hol ){ print HI "Today is a holiday: $hol\n"; print "Today is a holiday: $hol\n"; exit; } #create the IC convert hash &create_ic_conv; ### process ADB records ### $records = 0; $ret = "\n". &adb_Create; my $error; $error = 0; &do_ftp( 'adb', \$error ) if( not $g_testing and $records > 0 ); print $ret; print HI $ret; if( $error == 1 ){ my $txt = "FTP error. ADB file ". &adb_GetFilename. " not FTPed. T +he ADB records will not be processed.\n"; print $txt; print HI $txt; &send_mail("ADB/CAS FTP Error", $txt); close HI; $dbh->disconnect; exit; } ### process CAS records ### $records = 0; $ret = "\n". &cas_Create; &do_ftp( 'cas', \$error ) if( not $g_testing and $records > 0 ); print $ret; print HI $ret; if( $error == 1 ){ my $txt = "FTP error. CAS file ". &cas_GetFilename. " not FTPed.\n +"; print $txt; print HI $txt; &send_mail("ADB/CAS FTP Error", $txt); close HI; $dbh->disconnect; exit; } ...
In reply to ADB/CAS FTP Error by MASHIKOO
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |