I am trying to use the logParse Macro, but having some issues being able to reference the logfile which i am redirecting to the server - I have searched the community responses to this, but i cant find anything that solves my issue.
The code I am submitting :
options fullstimer;
%let files \\serverxx ;
%let logParse = \logparse.sas;
%let passInfo = \passinfo.sas;
%include "&files.&passInfo";
%passInfo;
filename logfile "\\serverxx\esa.log" ;
proc printto log= logfile ;
run;
data esa;
set benefit.esa_history (where=(date_data_Extract > "01dec2016"d));
run;
%include "&files.&logParse";
%logparse(logfile , myperfdata);
When i submit this and call the %logparse file - i dont seem to be able to be passing the correct reference to the log - i am using the filename in this instance, but have also tried the full path and other options to no avail.
On submitting the code above - i recieve the following message in the log which appears to suggest SAS is looking in the default SASAPP folder?
NOTE: Variable abovemem is uninitialized.
ERROR: Physical file does not exist, C:\SAS\Config\Lev1\SASApp\logfile.
Appreciate any thoughts / advice on how to solve this.
Thanks.
Agreed on the name!
I actually managed to solve this myself earlier but hadnt got around to updating this. I had been trying the full path approach you mentioned below, but discovered that i didnt need the quotes - when i removed these, the code worked fine.
- use the full path
%logparse(\\serverxx\esa.log, myperfdata);
Hi Damian (great name )
My guess is that the input parameter LOGFILE (from %logparse(logfile , myperfdata);) is not recognized as the filename you defined earlier.
As such, it's trying to find a file name LOGFILE from the default folder use by the Workspace Server (you're using EG?) which is C:\SAS\Config\Lev1\SASApp.
i'm thinking of 2 options:
- use the full path
%logparse("\\serverxx\esa.log", myperfdata);
- use a macro-variable
%let logfile='\\serverxx\esa.log';
%logparse(&logfile., myperfdata);
Hope that helps.
Cheers,
Damo
Agreed on the name!
I actually managed to solve this myself earlier but hadnt got around to updating this. I had been trying the full path approach you mentioned below, but discovered that i didnt need the quotes - when i removed these, the code worked fine.
- use the full path
%logparse(\\serverxx\esa.log, myperfdata);
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.