Help using Base SAS procedures

macro variable resolution in pipe??

Reply
Frequent Contributor
Posts: 110

macro variable resolution in pipe??

data two;

set one(keep=year);

call symput('newyear',year);

run;

filename dirlist pipe 'ls "/data/set1/&year." /s';

here &year. is not resolving.

any papers on this pipe?

Super User
Super User
Posts: 7,076

Re: macro variable resolution in pipe??

Use double quotes on the outside to allow macro variable references.

data _null_;

  set one ;

  call symputx('newyear',year);

   stop;

run;

filename dirlist pipe "ls -R ""/data/set1/&year"" " ;

Frequent Contributor
Posts: 81

Re: macro variable resolution in pipe??

Hi,

Try this with single quotes around the file path:-

data two;

set one(keep=year);

call symput('newyear',year);

run;

filename dirlist pipe '/data/set1/&year.';

/Daman

Ask a Question
Discussion stats
  • 2 replies
  • 220 views
  • 0 likes
  • 3 in conversation