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

Hey everyone! I'm in bit of a pickle and have spent hours trying to figure this out so hoping someone out there can help. I have a project in SAS EG that contains two programs. Now, I inherited this project so I don't know what went into creating this project. But basically, one of the programs uses a &month and &year macro variable that gets defined in the Project Prompts screen when you run the project. These should be global variables.

 

In fact, &month is a global variable. When I run both programs, the variable gets initialized correctly.

But for whatever reason, that's not happening with &year. It works in Program A but is not present in Program B.

 

I put in this code in Program A to see the macro variables:

%put _global_;

 

The output is:

25 GOPTIONS ACCESSIBLE;

26 %put _global_;

GLOBAL MONTH November

GLOBAL YEAR 2018

 

But when I put the same code in Program B:

%put _global_;

 

I only get this:

22 GOPTIONS ACCESSIBLE;

23 %put _global_;

GLOBAL MONTH November

 

Does anyone know why this is happening?

1 ACCEPTED SOLUTION

Accepted Solutions
adventuresinsas
Fluorite | Level 6

Just an update to everyone: I discovered that the reason for this was because I didn't have the "Use prompt value throughout project" box selected for that particular prompt/macro variable. Checking that box solved my issue.

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Are you executing program A and program B in the same EG session? Are the lines of code before %put _global_; the same?

--
Paige Miller
adventuresinsas
Fluorite | Level 6

Just an update to everyone: I discovered that the reason for this was because I didn't have the "Use prompt value throughout project" box selected for that particular prompt/macro variable. Checking that box solved my issue.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1189 views
  • 0 likes
  • 3 in conversation