Hi - I have done a lot of coding in Matlab - but am brand new to SAS. I can already see the parallels to Matlab - particularly with the SAS macros - which I can see I HAVE to master to get the most out of the thing. However, I am having a frustrating time, right at the outset - not able to get even the simplest of macros to work. My problem is, every time I try and run it, I get: "WARNING: Apparent invocation of macro OFFSPRING_ANALYSIS_MACRO not resolved."
Now, I have been reading online for 2 days solid - and have read most everything around this issue, and still cant seem to nail it!!! Thats why I'm here! I have gone over it with a fine tooth comb - the macro name matches the definition name - I am using SASAUTOS to specify my macro location....I realise there could be a problem here but it all looks OK...which leaves an error in the macro definition as the only other source of error I can think of... To not be able to get over this first step is really frustrating, as I feel the main chunk of logic flow and all that is not too far beyond me - but if you cant even get started... OK so below I will show you exactly what code I am using - please can somebody point out what I'm doing wrong? Thanks in advance!
I have two programs - one is a calling program - which I am trying to use to call my macro - which is the other program. So, in my calling program, I have the following:
/*************************************************************************************/
/*This is the calling program*/
%LET mainroot = C:\Users\Dave\Documents\Evolution Work;
OPTIONS SASAUTOS= ("&mainroot\Macros") MLOGIC mprint MERROR SERROR SYMBOLGEN MAUTOSOURCE MCOMPILENOTE=all NOTES SOURCE SOURCE2;
%Let dependant = Av_Baby_TL;
%Let cov = Av_baby_SVL_1 ;
%Let fixed = Species;
%Let fac1 = Offspring_Sex;
%offspring_analysis_macro(&dependant,&cov,&fixed,&fac1);
/*************************************************************************************/
/*And this is the macro that I am trying to call above - named offspring_analysis_macro */
%macro offspring_analysis_macro(dependant,cov,fixed,fac1);
proc glm data = Sexratio.Offspring;
class &fixed &fac1 ;
model &dependant = &cov &fixed &fac1 /solution;
run;
%mend offspring_analysis_macro;
/*************************************************************************************/
/*And thats it! the macro is held in the location specified up in the calling routine - the calling routine is kept elsewhere The dataset Sexratio.Offspring is in one of my libraries called Sexratio - that I have been using for manual analysis (i.e. non macro analysis)*/
Thanks a lot for taking the time to help out and I look forward to getting over this first sticky wicket!!
All the best
Davo.