BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
danbowers
Calcite | Level 5

Please see the code snippet below:

 

   %let path=/folders/myfolders/ecprg293; 

 

   Data saleQ1;
       infile '&path/sales.dat';
      *infile '/folders/myfolders/ecprg293/sales.dat';
       input @1 SalesID $4.;
   run;

 

I get the error: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/&path/sales.dat. when using the infile statement that includes the &path macro reference.

 

if I comment out that line, and use: infile '/folders/myfolders/ecprg293/sales.dat'; Line,  it works fine.

 

using VirtualBox 5.2.8

 

 

What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
danbowers
Calcite | Level 5

Wow, I was pulling my hair out, didn't even realize I was using single quotes, Thank you!!!

View solution in original post

5 REPLIES 5
SASKiwi
PROC Star

Use double quotes to resolve the macro variable, single quotes stop the resolution:  infile "&path/sales.dat";

danbowers
Calcite | Level 5

Wow, I was pulling my hair out, didn't even realize I was using single quotes, Thank you!!!

femi28
Calcite | Level 5

I am getting the same message for this short script;

Data Convert;
infile "/Users/femioluwa@gmail.com/My Folder/My Snippets/femi/celsius.txt";
input Temp_C;
Temp_F = 1.8*Temp_C + 32;
run;

 I am working on a SAS® Viya®  SAS Visual Analytics environment  application

sachinsunny
Calcite | Level 5

try

infile '"path"' ; 

    single quote followed by double 

pareshrodrigues
Calcite | Level 5

"Hello Everyone,

 

I am working on two Ports. Lev1 on Port:8561 with SAS Visual Analytics 7.1 and Lev2 on Port:8562 with SAS Visual Analytics 7.4 
The entire process/project is working fine (importing raw files, data modelling and uploading data to LASR server). And now we want to migrate from SAS VA 7.1 to SAS VA 7.4 and hence we are now running the code on Lev2 Port:8562. But the problem is the import/export code isn't working on Lev2. 

 

25 GOPTIONS ACCESSIBLE;
26 PROC IMPORT DATAFILE= "D:\VA_Data\RF productivity data\RF_SUBCATEGORY_TAT_DETAILS.xlsx"
27 OUT= expo_ccd.RF_SUBCATEGORY_TAT
28 DBMS=xlsx
29 REPLACE;
30 SHEET="Sheet1";
31 GETNAMES=YES;
32 RUN;

ERROR: Physical file does not exist, D:\VA_Data\RF productivity data\RF_SUBCATEGORY_TAT_DETAILS.
NOTE: The SAS System stopped processing this step because of errors.

 

I tried switching ports and running same piece of code so its running properly on Lev1 and not working on Lev2. 
Where Lev1 & Lev2 are similar only difference is pointing to different versions of SAS VA.

 

Please help how do I resolve this."

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 8557 views
  • 1 like
  • 5 in conversation