Thanks for the post, I can totally get the base process to work as shown, however I have a process that take some 4 hours of processing time that I run via a task manager and wanted to add a date-time log to and a parameter option to keep any random co-worker from accidently running this when not needed. That all seems to be working somewhat okay (logging not what I expected but it's okay) I am willing to share that if useful to the blog readers. What is very strange is the original program creates a report not just a data set, that report will auto create a name of the SAS program name minus '.sas' a date stamp and .xlsx via manual runs. Now in the batch, without SAS original code change, the report is just '_date stamp.xlsx' My questions does anyone have any idea why the name of my report file fails to generate and a way to fix that will work in both manual running of this SAS program and batch running? Here is my SAS code that calculates the name if it helps:
%macro fdate(fmt);
%global fdate;
%global tdate;
data _null_;
call symput("fdate",left(put("&sysdate9"d,&fmt)));
call symput("tdate",left(put(today(),&fmt)));
run;
%mend fdate;
%fdate(yymmddp10.) ;
%put &fdate ;%put &tdate ;

%Let FName = %SysGet( SAS_EXECFILEPATH ) ;
%put &fname;
%let sasfile= %sysget(SAS_EXECFILEname);
%put &sasfile ;
%let odsfile=%qsubstr(&sasfile,1, %length(&sasfile)-4);
%put &odsfile;
%Let PName = %qsubstr(%sysget(SAS_EXECFILEPATH),1, %length(%sysget(SAS_EXECFILEPATH))-%length(%sysget(SAS_EXECFILEname))) ;
%put &pname;
%let outputfile=&odsfile._&tdate..xls;
%put &outputfile;

'outputfile' is given to the ODS code as the 'file = &outputfile.;' parameter

PS the batch code does this with the base example and my expanded use (adding log and parameter option), so I assume I have not broken anything with my additions, but of course am not 100% sure on this point. If needed I can send my batch along for review.