<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using a macro variable for directory (PROC IMPORT) in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/729027#M729</link>
    <description>&lt;P&gt;You did not include part of the log where the mistake was made.&amp;nbsp; But it is clear from the log that you have still added quotes to the value of the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS language compiler (and most languages) use quotes to distinguish string literals from object names.&amp;nbsp; So if you are writing SAS code like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put hello;
put "hello";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first line is referencing a variable named hello and the second line is referencing a string literal with the value of hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro processor is not a computer language. It is just a text expansion tool.&amp;nbsp; It does not look for variables and strings and statements and procedures.&amp;nbsp; It just looks for triggers that say HEY process this part of the text.&amp;nbsp; The triggers are the &amp;amp; and % characters.&amp;nbsp; So if you want to set a macro variable to the value hello you would type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=hello;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you have created a macro variable named X that contains five characters.&amp;nbsp; If instead you type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x="hello";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of having a string with five characters you now have a string with seven characters.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 12:20:17 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-03-25T12:20:17Z</dc:date>
    <item>
      <title>Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728893#M718</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;OK I'm really confused - I'm just trying to make my life easier by using a macro variable for the folder of my directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the complete path of the file I'm trying to import:&lt;/P&gt;&lt;P&gt;\\Work\SAS\EPG1V2\data\class_birthdate.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run proc import, it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="\\Work\SAS\EPG1V2_EG\data\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I use my macro variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dataf = "\\Work\SAS\EPG1V2_EG\data";



proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run that, it says it's an invalid physical name!! The weirdest thing is that this macro works when I use it for a LIBNAME statement for an Excel located &lt;STRONG&gt;in this exact same folder!!&lt;/STRONG&gt; What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 21:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728893#M718</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-24T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728898#M719</link>
      <description>&lt;P&gt;Close...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dataf = \\Work\SAS\EPG1V2_EG\data;



proc import datafile="&amp;amp;dataf.\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/375207"&gt;@Negarev&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;OK I'm really confused - I'm just trying to make my life easier by using a macro variable for the folder of my directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the complete path of the file I'm trying to import:&lt;/P&gt;
&lt;P&gt;\\Work\SAS\EPG1V2\data\class_birthdate.csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I run proc import, it works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="\\Work\SAS\EPG1V2_EG\data\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I use my macro variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dataf = "\\Work\SAS\EPG1V2_EG\data";



proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I run that, it says it's an invalid physical name!! The weirdest thing is that this macro works when I use it for a LIBNAME statement for an Excel located &lt;STRONG&gt;in this exact same folder!!&lt;/STRONG&gt; What am I doing wrong?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 21:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728898#M719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-24T21:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728901#M720</link>
      <description>&lt;P&gt;So you told the macro processor to generate this SAS code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="\\Work\SAS\EPG1V2_EG\data""\class_birthdate.csv"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you see the problem now?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 23:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728901#M720</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-24T23:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728950#M721</link>
      <description>Nope. Doesn't work - here is the error message:&lt;BR /&gt;Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE,&lt;BR /&gt;_DEBUG_.</description>
      <pubDate>Thu, 25 Mar 2021 02:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728950#M721</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-25T02:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728951#M722</link>
      <description>Thanks. I can see the problem. Not sure I can see the solution though...&lt;BR /&gt;&lt;BR /&gt;I've tried:&lt;BR /&gt;CATX(&amp;amp;dataf,"\class_birthdate.csv")&lt;BR /&gt;&lt;BR /&gt;No success though</description>
      <pubDate>Thu, 25 Mar 2021 02:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728951#M722</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-25T02:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728961#M723</link>
      <description>&lt;P&gt;The macro processor is just a simple text replacement tool.&amp;nbsp; So do not include text like quote characters that you do not need.&amp;nbsp; Do not include text that looks like function calls since those are just more text characters to the macro processor.&amp;nbsp; I seriously doubt that the name of the file you are trying to find starts with the uppercase letters CATX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;has give the right answer.&amp;nbsp; Do not insert the quotes into the macro variable.&amp;nbsp; Expand the macro variable inside of the quotes so its value becomes part of the path.&amp;nbsp; Also make sure to use double quotes to enclose the string literal because the macro processor ignores macro triggers inside of strings bounded by single quotes instead of double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have left some unbalanced quotes from your earlier attempts that inserted a lot of extra quotes, so start with a new SAS session.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dataf = \\Work\SAS\EPG1V2_EG\data ;
proc import datafile="&amp;amp;dataf\class_birthdate.csv"
  dbms=csv out=work.class_birthdate_import
  replace
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 03:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728961#M723</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-25T03:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728973#M724</link>
      <description>Thanks Tom. I've copied your code and pasted into my program, but no luck. I think I'm going to stay away from macro variables for now. This is so frustrating.</description>
      <pubDate>Thu, 25 Mar 2021 03:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728973#M724</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-25T03:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728977#M725</link>
      <description>&lt;P&gt;Copy the lines from the SAS log for the PROC IMPORT step and share.&amp;nbsp; Use the Insert Code button (looks like &amp;lt; / &amp;gt; ) to get a pop-up window to paste them so that the lines are not re-formatted by the forum editor.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 04:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728977#M725</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-25T04:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728978#M726</link>
      <description>&lt;P&gt;OK, so here is the log for the solution you provided:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="&amp;amp;dataf\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
PROCEDURE| _DISARM| STOP| _DISARM| 2021-03-25T04:08:07,323+00:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| |
_DISARM| 64053248| _DISARM| 32612352| _DISARM| 11| _DISARM| 19| _DISARM| 227| _DISARM| 286792913| _DISARM| 0.000000| _DISARM|
0.001000| _DISARM| 1932264487.323000| _DISARM| 1932264487.324000| _DISARM| 0.000000| _DISARM| | _ENDDISARM
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
NOTE: Line generated by the macro variable "DATAF".
32 ""\\Work\SAS\EPG1V2_EG\data"
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE,
_DEBUG_.

ERROR 76-322: Syntax error, statement will be ignored.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the error is obvious : we're getting a quadruple quote. So V2 would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace
;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the log for that V2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;32 proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
33 dbms=csv out=work.class_birthdate_import
34 replace
35 ;
36 run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: Invalid physical name.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For that V2, it is unable to find the file. So as was suggested before, I'll just add the dot (.) to join the two strings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile=&amp;amp;dataf."\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the log for that V3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;32 proc import datafile=&amp;amp;dataf."\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
33 dbms=csv out=work.class_birthdate_import
34 replace
35 ;
36 run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: Invalid physical name.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Same prob...&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 04:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728978#M726</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-25T04:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728979#M727</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/375207"&gt;@Negarev&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;OK, so here is the log for the solution you provided:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="&amp;amp;dataf\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
PROCEDURE| _DISARM| STOP| _DISARM| 2021-03-25T04:08:07,323+00:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| |
_DISARM| 64053248| _DISARM| 32612352| _DISARM| 11| _DISARM| 19| _DISARM| 227| _DISARM| 286792913| _DISARM| 0.000000| _DISARM|
0.001000| _DISARM| 1932264487.323000| _DISARM| 1932264487.324000| _DISARM| 0.000000| _DISARM| | _ENDDISARM
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
NOTE: Line generated by the macro variable "DATAF".
32 ""\\Work\SAS\EPG1V2_EG\data"
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE,
_DEBUG_.

ERROR 76-322: Syntax error, statement will be ignored.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the error is obvious : we're getting a quadruple quote. So V2 would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace
;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the log for that V2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;32 proc import datafile=&amp;amp;dataf"\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
33 dbms=csv out=work.class_birthdate_import
34 replace
35 ;
36 run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: Invalid physical name.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that V2, it is unable to find the file. So as was suggested before, I'll just add the dot (.) to join the two strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile=&amp;amp;dataf."\class_birthdate.csv"
dbms=csv out=work.class_birthdate_import
replace
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the log for that V3:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;32 proc import datafile=&amp;amp;dataf."\class_birthdate.csv"
SYMBOLGEN: Macro variable DATAF resolves to
"\\Work\SAS\EPG1V2_EG\data"
33 dbms=csv out=work.class_birthdate_import
34 replace
35 ;
36 run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: Invalid physical name.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Same prob...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="6"&gt;Large economy size hint: Do not include quotes as part of the macro variable.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Lets pick a small example code you can run. Look in the log to see the results.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;%let vwithq="ABC";
%let vnoq  =ABC;

/* examine how these resolve with another value*/

%put Value inside quotes: "&amp;amp;vwithq.\file.csv";
%put Value inside quotes: "&amp;amp;vnoq.\file.csv";

&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Which will get&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;for the first: 
     
Value inside quotes: ""ABC"\file.csv"

And for the second:
Value inside quotes: "ABC\file.csv"&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="4"&gt;The first output above is what you are creating. Your LOG shows you that. The "quadruple quote" comes from the bit that you placed the quotes in definition of the macro variable. And then enclosed those quotes inside more quotes in the path part of the macro. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;I will not say to never place quotes in a macro variable. But quite frequently the use means they will either not work generating errors as in this case, or generate unmatched quote pairs&amp;nbsp; the two quotes at the start are a matched pair meaning that the text of the value is no longer considered in quotes by the compiler. Results can be unpredictable. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please go back and look carefully at &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s first response. Note that there are NO QUOTES in the %let of the example solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you have not removed them yet.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 14:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728979#M727</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-25T14:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728980#M728</link>
      <description>Wow, thank you so much, it works now!</description>
      <pubDate>Thu, 25 Mar 2021 05:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/728980#M728</guid>
      <dc:creator>Negarev</dc:creator>
      <dc:date>2021-03-25T05:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using a macro variable for directory (PROC IMPORT)</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/729027#M729</link>
      <description>&lt;P&gt;You did not include part of the log where the mistake was made.&amp;nbsp; But it is clear from the log that you have still added quotes to the value of the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SAS language compiler (and most languages) use quotes to distinguish string literals from object names.&amp;nbsp; So if you are writing SAS code like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put hello;
put "hello";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The first line is referencing a variable named hello and the second line is referencing a string literal with the value of hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro processor is not a computer language. It is just a text expansion tool.&amp;nbsp; It does not look for variables and strings and statements and procedures.&amp;nbsp; It just looks for triggers that say HEY process this part of the text.&amp;nbsp; The triggers are the &amp;amp; and % characters.&amp;nbsp; So if you want to set a macro variable to the value hello you would type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=hello;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you have created a macro variable named X that contains five characters.&amp;nbsp; If instead you type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x="hello";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of having a string with five characters you now have a string with seven characters.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 12:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Using-a-macro-variable-for-directory-PROC-IMPORT/m-p/729027#M729</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-25T12:20:17Z</dc:date>
    </item>
  </channel>
</rss>

