BookmarkSubscribeRSS Feed
HitmonTran
Pyrite | Level 9

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:

HitmonTran_0-1644883582616.png

 

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:

HitmonTran_1-1644883682333.png

 

2 REPLIES 2
Reeza
Super User

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:

HitmonTran_0-1644883582616.png

 

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:

HitmonTran_1-1644883682333.png

 



 

SASKiwi
PROC Star

Also in the S_DSET program, the first line MUST have the statement - %macro s_dset(parameter1, parameter2, parameter3);

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1027 views
  • 2 likes
  • 3 in conversation