BookmarkSubscribeRSS Feed
HeidiDT
Quartz | Level 8

Hi All

We have a batch process that uploads a number of files from a Unix server to an ftp site. Recently the ftp site (which is a windows server), ran out of space during the process and around 10 files were not ftp-ed. Our problem is that it is not logged as a failure in SAS, and therefore we had no visibility of the problem. Is there an option that should be added to the code below to cause failure?

 

Code submitted:

filename ftpcmds "/sas/batch/sascode/models/ftp/ftp.cmd";

data _null_;
file ftpcmds pad lrecl=80;
put "user &sasbatchuser &sasbatchpass";
put "ascii";
put "lcd /sas/batch/sascode/models/export";
put "cd SAS_IMPORT";
put "put model_&model_id._&output_date..csv";
put "bye";
run;

filename doftp pipe "ftp -n &EDWGW < /sas/batch/sascode/models/ftp/ftp.cmd";
data _null_;
infile doftp;
input;
put _infile_;
run;

 

SAS log:

SYMBOLGEN: Macro variable EDWGW resolves to prd-edwgw01
MPRINT(APPLY_MODEL): filename doftp pipe "ftp -n prd-edwgw01 <
/sas/batch/sascode/models/ftp/ftp.cmd";
MPRINT(APPLY_MODEL): data _null_;
MPRINT(APPLY_MODEL): infile doftp;
MPRINT(APPLY_MODEL): input;
MPRINT(APPLY_MODEL): put _infile_;
MPRINT(APPLY_MODEL): run;

NOTE: The infile DOFTP is:
Pipe command="ftp -n prd-edwgw01 < /sas/batch/sascode/models/ftp/ftp.cmd"

Local directory now /sas/batch/sascode/models/export
There is not enough space on the disk.
Command not understood.

3 REPLIES 3
Kurt_Bremser
Super User

Try a redirection of stderr to stdout:

filename doftp pipe "ftp -n &EDWGW < /sas/batch/sascode/models/ftp/ftp.cmd 2>&1";
data _null_;
infile doftp;
input;
put _infile_;
run;

and then look what you get in the log when you force an out-of-space condition. This might enable you to scan for the relevant text snippet and do a conditional abort abend or the like.

Kurt_Bremser
Super User

PS if the files were originally written from SAS, you might consider to use filename ftp and write the files directly to the FTP server. That way, SAS will catch the disk full condition.

HeidiDT
Quartz | Level 8

Thanks @Kurt_Bremser! Busy trying that out as we speak 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2237 views
  • 0 likes
  • 2 in conversation