DATA Step, Macro, Functions and more

WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

 

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 GROUPORDER, or ACROSS variable is missing on every observation


Accepted Solutions
Solution
a week ago
Super User
Super User
Posts: 7,060

Re: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

[ Edited ]

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?

 

View solution in original post


All Replies
Super User
Posts: 19,822

Re: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

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;
Occasional Contributor
Posts: 5

Re: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

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 closeSmiley Wink at the end of proc reports so maybe it's being called later and is still in effect for the second run?

Super User
Posts: 19,822

Re: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation


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. 

 

 

Solution
a week ago
Super User
Super User
Posts: 7,060

Re: WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation

[ Edited ]

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?

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 124 views
  • 0 likes
  • 3 in conversation