Setup: I have a very long program that puts 83 files in my temp library. There are three proc report macros that produce an .xml output file with three tabs.
Problem: When I run my program the first time, one of my proc report .xml output tabs doesn't display, but i get no errors. The second time I run it, it displays. If I shut down and restart, the same thing happens. Does that means my third proc report program is calling on the dataset before it's created or does it have something to do with this warning that I only get on the first run: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation
Sounds like the logic of your macro is messed up. Most likely with the timing of the generation of macro variables.
One likely issue is you might be referencing a macro variable in a data step before the macro variable has been created and this is causing you to generate missing values. Then on the second pass it works because you created the macro variable on the first pass.
Or perhaps a missing RUN or QUIT statement so that global statements like TITLE or ODS get applied to the wrong step?
I wouldn't trust the results from the second run then.
Look at your log and see where it's error occurs.
Use the following options to get information in your log:
options mprint symbolgen mlogic;
Thank you. I have those settings already. I can see where it occurs. The warning occurs on the first run only, in the log section of the tab that is displaying no data. I checked the order order= settings on my other proc report sections and I don't see a difference. I don't clear my ods tagsets (ods Tagsets.ExcelXP close;) at the end of proc reports so maybe it's being called later and is still in effect for the second run?
@LuAnnS wrote:
Thank you. I have those settings already. I can see where it occurs.
Ok, we can't see any of those though, so sure your logic is wrong somewhere.
If you don't have ODS <destination> CLOSE the file won't be created, but the second run shouldn't impact that unless you have a CLOSE earlier.
Sounds like the logic of your macro is messed up. Most likely with the timing of the generation of macro variables.
One likely issue is you might be referencing a macro variable in a data step before the macro variable has been created and this is causing you to generate missing values. Then on the second pass it works because you created the macro variable on the first pass.
Or perhaps a missing RUN or QUIT statement so that global statements like TITLE or ODS get applied to the wrong step?
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.
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.