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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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