BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASHunter
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

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

View solution in original post

8 REPLIES 8
Doc_Duke
Rhodochrosite | Level 12

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

SASHunter
Obsidian | Level 7

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 

Doc_Duke
Rhodochrosite | Level 12

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

SASHunter
Obsidian | Level 7

Doc,

Do you mean putting the OPTIONS statement before the execution of %MAIN or before the line that starts with

'%MACRO MAIN;'  ?

NANCY

Tom
Super User Tom
Super User

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. 

SASHunter
Obsidian | Level 7

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

Tom
Super User Tom
Super User

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.

SASHunter
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1583 views
  • 0 likes
  • 3 in conversation