I am running on SAS 9.4 environment.
In my macro folder "c:\macro", I have two files a.sas and b.sas. a.sas contains %a definition and similary b.sas contain %b definition
%a;
filename mac_ref "c:\macro";
options APPEND = SASAUTOS=(,mac_ref);
%b;
%a;
call of %b is successfull and call %a throws error "Apparent symbol not resolved".
Problem that I am facing is If I call any macro before Options append then it do not resolve at all in the session, even after reference appended in SASAUTOS.
What you are seeing is standard SAS behaviour. When you first call %A it will not be found as SASAUTOS follows. SAS defines a dummy macro called A since it cant find the real A. This then blocks you from finding the real A after your SASAUTOS statement.
A good practice is to put your SASAUTOS statement into your AUTOEXEC.SAS program so it will be run each time you start SAS. That way even a macro call as your first program statement will always work.
What you are seeing is standard SAS behaviour. When you first call %A it will not be found as SASAUTOS follows. SAS defines a dummy macro called A since it cant find the real A. This then blocks you from finding the real A after your SASAUTOS statement.
A good practice is to put your SASAUTOS statement into your AUTOEXEC.SAS program so it will be run each time you start SAS. That way even a macro call as your first program statement will always work.
It is filename.
That is a SAS program file , Not compiled macro of SAS . You can't use it in this way. Should be : %include 'c:\temp\a.sas'; %include 'c:\temp\b.sas';
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.