BookmarkSubscribeRSS Feed
rojouno
Calcite | Level 5

Hi everyone, can I use macros in SAS University Edition? I am in educational research, PISA 2015 and 2018, and I want to use the macro that the OECD provides to deal with the 10 plausible values, and to make multilevel models.  I have experience in SPSS, but macros in SPSS do not work for me, or I do not know how to make them work, and there are only 5 plausible values.

https://www.oecd.org/pisa/data/httpoecdorgpisadatabase-instructions.htm

Thanks, Walter

6 REPLIES 6
ketpt42
Quartz | Level 8
Yes, you can use macros in SAS University Edition.
ballardw
Super User

I am not going to read 100's of pages of documentation for a third party product so you'll have to do some work.

 

I found links to several macros, so which specific one are you attempting to use?

 

You are quite likely to have issues if you are new with SAS. The most common is that the macro code has to be submitted to compile the macro. That is the code that starts with the %macro statement and then ends with %mend.

Then you call the macro with something like:

%thatmacro (<and the parameters go here>)

The macro definitions hopefully let you know what each value should look like and what it would reference. Common items are source datasets, output data sets and options for the macro to use.

 

If you attempt to run macro code without compiling it first you get errors like this:

529  %thismac(a=b)
     -
     180
WARNING: Apparent invocation of macro THISMAC not resolved.

ERROR 180-322: Statement is not valid or it is used out of proper order.

That means you need to submit the code that should start with: %macro thismac(a= ) .

Other issues, such as missing or incomplete parameters are bit harder. You can turn on additional information in the log by submitting:

OPTIONS MPRINT;

That will have the Log contain the generated code and any issues like warning or error messages will appear in closer proximity to the generated code that caused the message.

 

If you have errors or warnings: Execute the Options mprint; run the macro. Copy from the log all of the generated code with all of the messages (yes this gets long but many issues with macro mischief come from a "minor" piece missing many lines before). Then on the forum open a code box with the </> and paste the code and log. This last step is important. Look earlier in this post for the code with the error I posted. There is an _ character under the % for thismac . That is a diagnostic character that indicates the first place SAS found an issue. If you paste the code in the main message window on this forum then the character will not appear in the correct place as the message windows will reformat text by removing white space (and actually replace it with HTML tags) which means what you see is not what the diagnostic intends.

 

 

rojouno
Calcite | Level 5

Thanks for you reply

"I found links to several macros, so which specific one are you attempting to use?"

Education. International Assessment, for use in PISA 2015 / 2018

Does anyone on the forum have any experience in these macro?

Walter

ballardw
Super User

@rojouno wrote:

Thanks for you reply

"I found links to several macros, so which specific one are you attempting to use?"

Education. International Assessment, for use in PISA 2015 / 2018

Does anyone on the forum have any experience in these macro?

Walter


Again, that link is a ZIP file containing multiple files.

Jade2021
Calcite | Level 5

Hi, Walter,

 

Have you solved this issue? I found the SAS macro provided by OECD had not been updated for multilevel modeling analysis with 10 plausible values. How did you deal with this? 

Looking forward to your reply.

 

Jade

rojouno
Calcite | Level 5

Hi, in principle I took as a reference the PISA Data Analysis Manual, SAS, second edition, 2009. I started from the basics, regressions, then regressions with plausible values. I copied the logic and developed it in R. It was not easy. I have taken a course in SAS Macro Language, as well as R and multilevel models.
I am currently doing the same with Multilevel. I am in the same book, chapter 15. multilevel regression model with random intercepts and fixed slopes. I already know how to do with a only one plausible value, in an example from the book with Belgium 2006 science.
I am just standing in Box 15.3 [1/2] , page 211

Walter,

walbornoz_the_one@yahoo.com

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 884 views
  • 1 like
  • 4 in conversation