From: SAS User on
Hi,

I am trying to collect a file name from a field but the variable does
not seem to get translated. My source dataset only has one record in
so should pick it up ok.

proc sql;
select name into :expfile
from exportfilec;
quit;

proc import datafile = 'c:\&expfile.' out=work.fields_tmp1;
run;

99 proc import datafile = 'c:\&expfile.' out=work.fields_tmp1;
100 run;

ERROR: Unable to import, file c:\&expfile.XLS does not exist
From: Tom Abernathy on
SAS does not expand macro variables inside of single quotes.
Use double quote characters and the value of the macro variable
EXPFILE will be expanded.

proc import datafile = "c:\&expfile" out=work.fields_tmp1; run;


On Feb 3, 3:25 pm, SAS User <sasuser2...(a)googlemail.com> wrote:
> Hi,
>
> I am trying to collect a file name from a field but the variable does
> not seem to get translated. My source dataset only has one record in
> so should pick it up ok.
>
> proc sql;
> select name into :expfile
> from exportfilec;
> quit;
>
> proc import datafile = 'c:\&expfile.' out=work.fields_tmp1;
> run;
>
> 99   proc import datafile = 'c:\&expfile.' out=work.fields_tmp1;
> 100  run;
>
> ERROR: Unable to import, file c:\&expfile.XLS does not exist

From: SAS User on
Thank you :-)
Lee