I've been trying to do some error checking in my codes by using the automatic system variables like %syslibrc for the libname statement and %sysfilrc for the filename statements. But when I check the sysfilrc after a filename FTP statement with a wrong password to the FTP server, the value still remains 0. See the code below:
My experience indicates that the FTP request doesn't really "happen" until you use it, like in a data step. For example:
72 filename tempone ftp "'abc.def.ghi'"
73 host = 'MYHOST'
76 /*recfm = fb
77 lrecl= 152*/
78 debug ;
80 %put &sysfilrc;
81 data _null_;
82 infile tempone;
84 put _all_;
NOTE: 220-FTPSERVE IBM FTP CS V1R11 at MYHOST.com, 12:31:58 on 2010-11-24.
NOTE: <<< 220-FTPSERVE IBM FTP CS V1R11 at MYHOST.com, 12:31:58 on 2010-11-24.
NOTE: <<< 220 Connection will close if idle for more than 480 minutes.
NOTE: >>> USER XJOE
NOTE: <<< 500-UX-FTPA616 Command rejected by Security Server
NOTE: <<< 500 User Exit denies Userid '' from using Command 'USER'.
ERROR: Invalid username..
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.18 seconds
cpu time 0.01 seconds