Hi,
I have a large program that has the following OPTIONS statement at the top of the program:
options obs=max mprint mlogic symbolgen macrogen source2 errors=1 validvarname=upcase;
The program starts with the OPTIONS statement then the normal %LETs and FILENAME statements.
Then there is a %MACRO .... %MEND
and then another %MACRO called 'MAIN'
and the %MEND MAIN is on the last page. And then the execution of the MACRO 'MAIN'.
There is one other OPTIONS statement with only the following ( MISSING = ' ' ) close to the last page inside the MAIN macro.
My problem is that I do not receive any of the macro generated code in my LOG file. I need this information
and I can't figure out why it is not showing up.
Also this is being run on a LINUX machine. Attached is a small test program I ran that worked fine.
Thanks for any suggestions here.
Nancy
Try putting
OPTIONS MPRINT;
right in front of the last macro. It is a kluge, but will allow you to see the other code.
Doc
If you say that the test ran fine, then it is a problem in the program itself and not with SAS. I wonder if the OPTIONS statement might have been commented out inadvertently. The other thing to look for is a NOMPRINT somewhere. I know you said that there were no other options, but it might be hidden in some other included or autocall code.
Doc Muhlbaier
Duke
So I looked at the program again and find no other OPTIONS statements (besides those two I mentioned). The program does contain two %INCLUDE and in looking at those, there is no OPTIONS inside these. This program is in a production directory and I thought maybe there was some type of automatic SAS generated code that suppressed the OPTIONS, but I have other log files where the macro generated code appears.
This is all so puzzling!!
Thanks, Nancy
Try putting
OPTIONS MPRINT;
right in front of the last macro. It is a kluge, but will allow you to see the other code.
Doc
Doc,
Do you mean putting the OPTIONS statement before the execution of %MAIN or before the line that starts with
'%MACRO MAIN;' ?
NANCY
Are you sure that the macro generated any code?
It is possible that the code is conditional and in your current program the macro has decided to skip all of the parts that generate code.
It is possible the create macros that only execute macro statements and hence will not generate any code.
I changed the first OPTIONS statement back to what it had previously been:
OPTIONS obs=max mprint errors=1 validvarname=upcase;
And I added a new OPTIONS statement, just 'OPTIONS MPRINT' right before the MACRO 'Main' line.
OPTIONS MPRINT;
%macro main;
---------------------------------------------------------------------------------------------------------------------------------------
Now it works!
Why it doesn't recognize the first MPRINT statement I'd like to know!!
Thanks for the suggestion.
Nancy
I would look first to make sure that the OPTION statement is actually running. It is possible that there is some character in front of it that is converting it into a comment or text string.
Otherwise you would need to check the program statements to see if there are any that have turned off the MPRINT option.
Tom,
After you said that, I thought I'd try one more thing.
I copied the beginning of that problem - (which is three pages of comments) and the first couple lines of code that included the OPTIONS statement; into a small program. I then opened up a SAS windowing session on the LINUX machine and opened up this new program. Sure enough the OPTIONS statement was being seen as part of the comments above it.
Now not that I didn't think of that before, I looked at the comments and saw that it ended with a slash. But the problem was that the slash at the very top of the program was missing. This made the next line (OPTIONS statement) become part of the comments because the OPTIONS statement ended with the first semicolon.
Wow - what a headache. :smileyplain:
Thanks, Nancy
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 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.