Hi ,
I have an issue with a macro variable. When i run it for first time, it runs fine ... in the 2nd run when i change the input year, it still retains the value from previous run. although i do see taht the correct row is fetched (since I have not mentioned noprint its displaying the result.) but the log shows the macro is still retaining a year from the prev run..
| PROC SQL ; | ||||
| SELECT TRIM(MAX(NAME)) into :Max_date | ||||
| FROM DICTIONARY.COLUMNS | ||||
| WHERE LIBNAME='WORK' AND MEMNAME = 'ADDT_LOOKUP' | ||||
| AND substr(NAME,1,5) = "D&YEAR."; | ||||
| QUIT; |
Hi Reeza,
Thank you for your response. I have found the reason.
Earlier i was using the call execute which was causing this issue.
DATA _NULL_ ;
Set MSAFrmt.regions_list ;
call execute('%FETCH_RECORDS('||Orgnm||")");
Run;
Now instead of using the sas data step if i directly call the macro %FETCH_RECORDS(co) it does not give this issue.
Thanks again.
I have tried using %symdel and then recreate it but it does not work
Post your full log with the %put statements between each call.
Use option mprint and symbolgen to see what is occurring.
Hi Reeza,
Thank you for your response. I have found the reason.
Earlier i was using the call execute which was causing this issue.
DATA _NULL_ ;
Set MSAFrmt.regions_list ;
call execute('%FETCH_RECORDS('||Orgnm||")");
Run;
Now instead of using the sas data step if i directly call the macro %FETCH_RECORDS(co) it does not give this issue.
Thanks again.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.