Hi,
I am trying to refer SAS codes in %INCLUDE statement for SAS codes on my local machine. I am following the below steps suggested:
This setting is maintained per project. To set it:
1.Select File->Project Properties. The Properties window appears.
2.Select the File References tab.
3.Check the box: "Use paths relative to the project for programs and importable files"
I am creating tow SAS codes as:
1. h:\test\outer.sas
%put outer;
%include "inner.sas";
2. h:\test\inner.sas
%put inner;
NOTE: I have also tried saving the Project in the same directory (h:\test)
when I execute the SAS code I get the below error:
WARNING: Physical file does not exist, /var/applications/sas/config94/Lev1/SASApp/inner.sas.
ERROR: Cannot open %INCLUDE file inner.sas.
Can someone help me understand what I am missing to provide the relative path reference?
Thanks
Ved Agrawal
The %INCLUDE statement runs on the SAS server and has therefor no knowledge of files on your local machine where the SAS Enterprise Guide runs.
I see two ways to do this:
Where are you saving your EGP files?
and what are you expecting the PUT statement to do in that code?
in the same location as the codes are.
From the Put code I just want to understand if I can get in to the inner.sas code.
@Ved_Agrawal wrote:
From the Put code I just want to understand if I can get in to the inner.sas code.
No, %include runs the code in the program inner.
I suspect this this is because SAS is actually on the server, not locally. If you can’t run EG locally, I don’t know if this approach will work.
The %INCLUDE statement runs on the SAS server and has therefor no knowledge of files on your local machine where the SAS Enterprise Guide runs.
I see two ways to do this:
Thanks for the solution. Actually I was foolish to try include one SAS code into another, where as SAS EG provides use of Flow for this.
without include it can be simply done as you suggested "Add your local code to the processflow, as you do with other code and link the programs in your processflow. Use the RightMouseButton and select "Link Program to ..." to draw the connection"
Regards
Ved Agrawal
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.
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.