Write and run SAS programs in your web browser

%include difficulties

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

%include difficulties

Hi,

 

Has anyone attended the Macros Essentials course?  I'm attempting to access the programs used on the course via SAS Stuidio, which needs a program to run that creates data (cre8data).  This program includes the following statements;

 


%let path=s:\workshop;

 

and

 

%include "&path\setup.sas" ;

 

My problem is that I am unable to put a path in the %let statement which works with the %include, On the course the 's:\workshop' path was used but this was obviously a path that was valid on the machines in the SAS office.  I need to change this path to one that can access the files on my machine.  I access SAS Studio via VMWare Player and I've checked that the VM has the shared folder path of the physical location.  I can see the file that I need in Folder Shortcuts.

 

No matter which paths I try I keep getting the following errors;

 
WARNING: Physical file does not exist,
/opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro.
ERROR: Cannot open %INCLUDE file 'C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro'\setup.sas.

 

So far I've tried referencing the path of the folder shortcut, in which the setup.sas file is present, and I've tried referencing the actual windows path on my laptop.  

 

Anyone have any ideas of where I'm going wrong?

 

Thanks

 

Anthony


Accepted Solutions
Solution
‎05-31-2016 06:10 AM
Super User
Super User
Posts: 6,498

Re: %include difficulties

The error message shows what you are doing wrong. You have given SAS a Windows path, C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro, but SAS is actually running on the Unix virtual machine. So it does not understand Windows syntax for path names. Hence it thinks you are looking for a file whose name starts with the characters uppercase C and colon and is in the current working directory. Hence the error message:  /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro.

 

Read the instructions on setting up the folder mapping.  Or look for the other 50 times this question has been asked on this site.  Or read this KB entry:  http://support.sas.com/kb/53/333.html 

 

 

View solution in original post


All Replies
Solution
‎05-31-2016 06:10 AM
Super User
Super User
Posts: 6,498

Re: %include difficulties

The error message shows what you are doing wrong. You have given SAS a Windows path, C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro, but SAS is actually running on the Unix virtual machine. So it does not understand Windows syntax for path names. Hence it thinks you are looking for a file whose name starts with the characters uppercase C and colon and is in the current working directory. Hence the error message:  /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\Anth\Documents\SASUniversityEdition\SAS_Macro\SAS_Macro.

 

Read the instructions on setting up the folder mapping.  Or look for the other 50 times this question has been asked on this site.  Or read this KB entry:  http://support.sas.com/kb/53/333.html 

 

 

Super User
Posts: 17,774

Re: %include difficulties


anthfoster wrote:

I access SAS Studio via VMWare Player and I've checked that the VM has the shared folder path of the physical location.  I can see the file that I need in Folder Shortcuts.

 

 


 

So you created a custom shared folder location, besides the myfolders required?

 

If so you access it as:

http://support.sas.com/software/products/university-edition/faq/shared_folder_access_existing.htm

 

The last line is key:

To reference this folder shortcut in a SAS program, use /folders/myshortcuts/folder-name

 

SAS Super FREQ
Posts: 8,740

Re: %include difficulties

Hi:
  You should NOT tamper with the %include. That program CRE8DATA.SAS is designed to run if these are true:
1)You unzip ALL the files into a directory location where you have WRITE access (you cannot just unzip the CRE8DATA.SAS program into the folder)

2) you make a folder called MC1 in that write location

3) you change the %LET statement (and ONLY the %LET statement in CRE8DATA.SAS) as appropriate for where you have unzipped the files in your  system and according to your method of using SAS:

In class: %let path=s:\workshop;
Windows: %let path= c:\classes\mc1;
Unix: %let path= /usr/classes/mc1;
SAS UE using shared folder location: %let path= /folders/myfolders/mc1;
SAS OnDemand: %let path=/home/your_username/mc1;
SAS UE with shortcuts: %let path=/folders/myshortcuts/mc1;

 

  Here's the ONLY statement you should change in the CRE8DATA.SAS program in the attached screen shot.

cynthia

 how_to_change_cre8data_make_files.png

New Contributor
Posts: 2

Re: %include difficulties

Thanks to everyone for your replies, your suggestions helped me realies that the '\' should have been a '/', which was causing the error.

 

Cheers


Anthony

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 742 views
  • 2 likes
  • 4 in conversation