Have you tried re-starting SAS and then running the code again?
Hey @LuisMijares! Take a look at this set of lines here:
****************************************************************************************************
/* Alzhimers diagnosis*
/*Assign 1 to ALZH_MEDPAR for matches in alzhimers_codes;
While the DATA Step can read and compile this correctly, the macro processor is unable to determine where the comment starts and stops. As a result, it's getting confused and causing an issue where things are commented out that are not expected. To resolve this, change these lines to the following:
/****************************************************************************************************/
/* Alzhimers diagnosis */
/*Assign 1 to ALZH_MEDPAR for matches in alzhimers_codes */
This will allow the code to run correctly in a macro. As a best practice, you should use /* */ for commenting rather than *; especially when using macros, as it is the safest to use per SAS KB0036213. I would recommend going through your code and removing any *; comments and replacing them with /* */
Why do you not end the data step inside the macro?
What statements did you submit after the macro call?
Perhaps that is where the extra END statement is being added to the last data step generated by the macro.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.