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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.