BookmarkSubscribeRSS Feed
bsitthid
Calcite | Level 5

Hello,

 

I get the following error when trying to run:

 

NOTE: Writing HTML Body file: \\shareddirectory\folder\subfilder\subfolder\output.xls
ERROR: Physical file does not exist, C:\Users\me\AppData\Local\Temp\SAS Temporary
Files\subfolder\\\shareddirectory\folder\subfilder\subfolder\output.xls
ERROR: No body file. HTML output will not be created.

 

I only referenced the shared directory \\shareddirectory\folder\subfilder\subfolder\ and never referenced my C:.

I'm wondering why it is prefixing with C: path and also why I keep getting this error? All the files I am referencing are in a shared network location.

8 REPLIES 8
ballardw
Super User

Windows kind of expects paths to start with a drive letter. If it doesn't then the path gets appended to the location that SAS executes or the default working directory location , hence the Users location.

 

Without knowing your set up it is hard to specify what the path may be but a shared directory would would at a minimum have to start with a server name.

 

Or do you have this set as network drive in Windows? If so use the network mounted drive letter.

Tom
Super User Tom
Super User

Make sure there isn't some invisible character in front of the \\ .  Also make sure that you are using whatever code you used to direct the HTML there properly. For example perhaps the setting where you placed that name is intended to hold just the filename part of the path and there is another setting where you are supposed to place the directory name.

Posting appropriate parts of the SAS log (using the Insert Code button) will help clarify what exactly you did and what SAS's exact message was.

SASKiwi
PROC Star

If you are running SAS on your PC, copy the shared folder path text into the Windows Explorer navigation box. If it doesn't work in Windows Explorer it is not going to work in SAS. Usually you have to add the file server name in front shared folder path in my experience. Ask your IT support what it should be.

bsitthid
Calcite | Level 5

I've done this and it works

bsitthid
Calcite | Level 5
libname HSMR "\\Grh202\hsmr\SAS\SAS_datasets";			* Enter your HSMR data directory ;
libname COEFFS "\\Grh202\hsmr\SAS"; 		* Enter the directory with the 6 SAS coefficient data files ;
%let _SASCode_Dir 	=\\grh202\HSMR\SAS\HSMR Code_June 2015_Batch;	* Enter the directory where the 7 BATCH SAS procedure code files are located (no quotes for this one);
%let _Output_Dir	=\\grh202\HSMR\SAS\HSMR Code_June 2015_Batch\Output;	* Enter the directory for the output spreadsheet files ;
%let _Input_Data	=sacrs.jan2020;					* Enter name (library.member) of the SAS data file you imported from Crystal Reports for this time period;
*******************************
Overall labels for this time period - These are only used to label the output - they do not subset the analyses
*******************************;
%let year		= 012020;			* Enter time period abreviation (up to 7 characters maximum)  ;
%let date_run	= 0417;			* Enter the date you are running these analyses (maximum 4 characters) ;

*******************************
Macros and Data processing
*******************************;
%Macro _bb;%include "&_SASCode_Dir.BATCH_HSMR_Macros.sas";Run;%Mend;%_bb;  *This loads the BATCH macros and processes the data (nothing to change here)*;

*******************************

 

bsitthid
Calcite | Level 5

And the error:

SYMBOLGEN:  Macro variable OUTLIB resolves to HSMR
SYMBOLGEN:  Macro variable YEAR resolves to 012020
SYMBOLGEN:  Macro variable SUBSET resolves to surgical
MPRINT(HSMR_QTR_GRP_GRP3_SUBSET):   proc print data = HSMR.hsmr_qtr_012020_surgical noobs;
MPRINT(HSMR_QTR_GRP_GRP3_SUBSET):   title "HSMR, updated methodology - Subsets";
SYMBOLGEN:  Macro variable YEAR resolves to 012020
SYMBOLGEN:  Macro variable VAR3 resolves to unique_id
SYMBOLGEN:  Macro variable VAR resolves to program
MPRINT(HSMR_QTR_GRP_GRP3_SUBSET):   title2 "Year: 012020, Unit: unique_id, program";
SYMBOLGEN:  Macro variable SUBSET resolves to surgical
MPRINT(HSMR_QTR_GRP_GRP3_SUBSET):   title3 "Subset = surgical";
MPRINT(HSMR_QTR_GRP_GRP3_SUBSET):   run;
WARNING: No output destinations active.
NOTE: There were 86 observations read from the data set HSMR.HSMR_QTR_012020_SURGICAL.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.11 seconds
      cpu time            0.01 seconds


MLOGIC(HSMR_QTR_GRP_GRP3_SUBSET):  Ending execution.
MPRINT(RUN_SURGICAL):  ;
26191  +title ' ';
MPRINT(RUN_SURGICAL):   title ' ';
26191 !+           title2 ' ';
MPRINT(RUN_SURGICAL):   title2 ' ';
26191 !+                       title3 ' ';
MPRINT(RUN_SURGICAL):   title3 ' ';
26192  +ods html close;
MPRINT(RUN_SURGICAL):   ods html close;
MPRINT(RUN_SURGICAL):   Run;
MPRINT(RUN_SURGICAL):   *** Output 3 ***;
26193  +Run;
26194  +*** Output 3 ***;
26195  +%let _outputnum=3;%HTMLFile_Out;
MLOGIC(HTMLFILE_OUT):  Beginning execution.
SYMBOLGEN:  Macro variable _OUTPUT_DIR resolves to \\grh202\HSMR\SAS\HSMR Code_June
            2015_Batch\Output\
SYMBOLGEN:  Macro variable _FILESUBSET resolves to SURGICAL
SYMBOLGEN:  Macro variable _RUN resolves to Run3
SYMBOLGEN:  Macro variable _OUTPUTNUM resolves to 3
MPRINT(HTMLFILE_OUT):  ods html file = "\\grh202\HSMR\SAS\HSMR Code_June
2015_Batch\Output\HSMR_SURGICAL_Run3_Output3.xls";
NOTE: Writing HTML Body file: \\grh202\HSMR\SAS\HSMR Code_June
      2015_Batch\Output\HSMR_SURGICAL_Run3_Output3.xls
ERROR: Physical file does not exist, C:\Users\username\AppData\Local\Temp\SAS Temporary
       Files\_TD9972_HLRC4095_\\\grh202\HSMR\SAS\HSMR Code_June
       2015_Batch\Output\HSMR_SURGICAL_Run3_Output3.xls.
ERROR: No body file. HTML output will not be created.
MLOGIC(HTMLFILE_OUT):  Ending execution.
MPRINT(RUN_SURGICAL):  ;
26196  +proc freq data=subset;
MPRINT(RUN_SURGICAL):   proc freq data=subset;
SYMBOLGEN:  Macro variable SUBSET resolves to surgical
26197  +title "Distribution of variables of interest in &subset. subgroup";
MPRINT(RUN_SURGICAL):   title "Distribution of variables of interest in surgical subgroup";
26198  +tables charlson_group transfer_in diag_flag_cancer diag_flag_renal diag_flag_stroke
26198 !+diag_flag_sepsis;
MPRINT(RUN_SURGICAL):   tables charlson_group transfer_in diag_flag_cancer diag_flag_renal
diag_flag_stroke diag_flag_sepsis;
26199  +run;
MPRINT(RUN_SURGICAL):   run;

WARNING: No output destinations active.
NOTE: There were 86 observations read from the data set WORK.SUBSET.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds
SASKiwi
PROC Star

I suggest you do a test where you hard code the ODS file path and not assign it via a macro variable. If this works then something in the macro resolution is causing the problem.

Cynthia_sas
SAS Super FREQ

Hi:

  Here is a visual explanation of why others have suggested that you figure out a hard-coded location that works before you run this macro program:

Cynthia_sas_0-1587220702783.png

 

  The cyan highlighting in the top screen clip from your log is the string you specified in the pink highlighted code from the second screen clip. The yellow highlights are the working directory that was defined to SAS when it was installed. Looks like a temporary location.

  Can you directly access the \\Grh202 network location? do you have write access? do you have ANY working code that writes to that location without being inside a macro program? If so, what does that code look like?

Hope this visual helps,

Cynthia

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 2233 views
  • 0 likes
  • 5 in conversation