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?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: