Can any one help me to resolve or fix the following syntax error:
So there are two separate errors.
The first is your use of the SQL AVG summary function. SQL summary functions need SQL expressions as arguments, and in SQL, variables must be separated by colons instead of spaces (as in a data step).
I also found that avg is only available for vertical use (one column over several records), for horizontal averaging (several columns in one record) you should use the mean() function.
So it should be
mean(Height,CMDS,CBSDL,CBSDS,CBSDRNharvest,SRNumber,SRMass,FSRYield,Groundbiomass,TBMass,Hindex,Dmcontent,BCarotene,PPD1w,PPD2w)
to make it syntactically correct.
The second error is the invocation of the macro %DialAnalFixModel, which is obviously not known to SAS at this stage. Make sure that a proper %include for the file where this macro is stored is in your program, or get the macro definition text and copy it into your program.
Well, it is a syntax error, meaning that the code is erroneous. We cannot help you without the code. Please post the whole log of the offending step.
So there are two separate errors.
The first is your use of the SQL AVG summary function. SQL summary functions need SQL expressions as arguments, and in SQL, variables must be separated by colons instead of spaces (as in a data step).
I also found that avg is only available for vertical use (one column over several records), for horizontal averaging (several columns in one record) you should use the mean() function.
So it should be
mean(Height,CMDS,CBSDL,CBSDS,CBSDRNharvest,SRNumber,SRMass,FSRYield,Groundbiomass,TBMass,Hindex,Dmcontent,BCarotene,PPD1w,PPD2w)
to make it syntactically correct.
The second error is the invocation of the macro %DialAnalFixModel, which is obviously not known to SAS at this stage. Make sure that a proper %include for the file where this macro is stored is in your program, or get the macro definition text and copy it into your program.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.