SAS Management Console - The file is empty and can not be sent

110 views Asked by At

I've scheduled some sas code using SAS Management Console.

However the job ends with an error: The file is empty and can not be sent.

The code which exports proc freqs to a file is as follows:

%let output_Date = %sysfunc(today(),yymmddn8.);
ods results off;
ods csv file="path/file.csv";
 %macro movem (st, en=); 
   %do j=1 %to &en.;
   %let k=%eval(&j.+1);
      proc freq data=dataname;
        tables status&j. * status&k. / nocol norow nopercent missing ;
      run;
  %end;
%mend;
%movem (st=1, en=%sysfunc(week(%sysfunc(today()), u)));
ods csv close;
ods results on;

I haven't used ods before and was wondering whether this causes the issue/error?

In Enterprise guide the code seems to give me no error.

Thanks in advance!

1

There are 1 answers

0
Leonid Batkhan On

In your code ods csv file="path/file.csv"; path is a placeholder, it should be replaced with actual path, e.g. /sas/projects/mypath,

or you can assign it to a macro variable:

%let path=/sas/projects/mypath;

Then your ods statement will look like: ods csv file="&path/file.csv";