Hi,
I have an error message where I cannot call a global macro. I'm not sure what the issue is, I tried adding MAUTOSOURCE (which I'm not sure if I wrote it correctly) and it didn't work. The one solution did work is if I write "include...directory..macro name" but that takes too much time to keep writing when there's a new macro to be used.
Any suggestion would greatly help, thank you
error message:
code:
%let wrk_folder=Working_Folder;
%let analydir=\\Biostatistics\Analysis\&wrk_folder;
%include "\\_dummy\programs\macros\U_setup.sas";*U_setup;
OPTIONS MAUTOSOURCE SASAUTOS=(SASAUTOS '\\_dummy\programs\macros');
%u_setup(&analydir);
************************************************************************
* Table 1 - Subject Disposition *
************************************************************************;
data analset;
set LIB_ADM.ADSL;
run;
title4 j=c 'Table 1' ;
%s_dset (analset, ENSEAL,e);
this is where my global macros are stored:
The structure of your code looks correct and I tested in OnDemand and it worked for me.
OPTIONS MAUTOSOURCE SASAUTOS=(SASAUTOS '/home/fkhurshed/Demo1/myMacros');
%print(dsn=sashelp.class);
Do you have anything in your %u_setup that may overwrite this?
And is that the full file path in your example? If not, I'd definitely include the full file path as a start.
@HitmonTran wrote:
Hi,
I have an error message where I cannot call a global macro. I'm not sure what the issue is, I tried adding MAUTOSOURCE (which I'm not sure if I wrote it correctly) and it didn't work. The one solution did work is if I write "include...directory..macro name" but that takes too much time to keep writing when there's a new macro to be used.
Any suggestion would greatly help, thank you
error message:
![]()
code:
%let wrk_folder=Working_Folder; %let analydir=\\Biostatistics\Analysis\&wrk_folder; %include "\\_dummy\programs\macros\U_setup.sas";*U_setup; OPTIONS MAUTOSOURCE SASAUTOS=(SASAUTOS '\\_dummy\programs\macros'); %u_setup(&analydir); ************************************************************************ * Table 1 - Subject Disposition * ************************************************************************; data analset; set LIB_ADM.ADSL; run; title4 j=c 'Table 1' ; %s_dset (analset, ENSEAL,e);
this is where my global macros are stored:
![]()
Also in the S_DSET program, the first line MUST have the statement - %macro s_dset(parameter1, parameter2, parameter3);
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.