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

Hi all SAS Users,

 

Today I had a chance to read some codes from other published papers. And I stuck at the first line

The first line is

%let SafeMode=0;

They explain it like that but I did not understand, could you please explain it to me? I did a search from google but no document available for this code?

 

/* Changing Safemode parameter to 1 would add few additional filters.  (default=0)
It is inactive in the default settings. It might be useful for first look at new datasets */
%let SafeMode=0;	

I know %let is used to assign a value for one variable, but do not know more than that for this code.

Warmest regards,

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

The program assigns a value of 0 to macro variable SafeMode.

What effect this has should be determined from the comment provided, and from how the macro is used.

It is a user-created variable and how it's used is entirely up to the person who used it.

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

The program assigns a value of 0 to macro variable SafeMode.

What effect this has should be determined from the comment provided, and from how the macro is used.

It is a user-created variable and how it's used is entirely up to the person who used it.

 

ballardw
Super User

If you have the entire code of the macro I will bet that you find at least one instance of

 

%if &safemode=1 %then <other code>

or

%if &safemode=0 %then <other code>

 

if not both. What comes after the IF is what the macro variable is controlling.

Phil_NZ
Barite | Level 11

Hi @ballardw 

 

You are right! There are some lines of code exactly what you mentioned

%if &safemode=1 %then <other code>

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 697 views
  • 2 likes
  • 3 in conversation