BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a number of conditions declared as macrovariables:

%let cond1=if x=10;
%let cond2=if x=20;
.
%let cond9=if x=90;

and an "empty" condition: %let cond10=;

I am creating 10 tables by looping in a macro:

%macro example;
%do i=1 %to 10;
data work&i;
set worktotal;
&&condition&i;
run;
%end;
%mend;
%example;

When i=1-9 I get the wanted conditions and when i=10 I get a single semicolon.

When i=10 work10 should be set to worktotal. This seems to work.

But I want to know if, in general, it's OK to place a single semicolon on a line in a data step where nothing should happen?
2 REPLIES 2
Flip
Fluorite | Level 6
Extra semicolons are fine. I have known several programmers that like to use them on blank lines to hold space. I have never figured out why they do this, but it does not hurt.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
With SAS version 6, there was a SAS code compiler issue when using SAS macros mixed with SAS old-style (SAS 79 style) macro statements within nested (multiple) %INCLUDE references. At times a SAS DATA statement would need to be ended with 4 or 5 semi-colons to ensure the compiler flushed well during compile processing.

Scott Barry
SBBWorks, Inc.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 938 views
  • 0 likes
  • 3 in conversation