BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8
PROC SQL NOPRINT;
CREATE TABLE PERF_ACCT AS
SELECT DISTINCT ORG_CODE, ACCOUNT_NO, LOGO, DATE_CARD_OPENED, BLOCK_CODE_1
FROM CREDIT_CARD;

*WHERE EFF_FROM_DATE<="&PERF_END"D
AND (EFF_TO_DATE>"&PERF_END"D OR EFF_TO_DATE=.);
QUIT;

generally I know that * means commenting a statement, however, here I am suspicious. Could you take a look and confirm for me if where statement above is commented and what about the line starting with AND ..., is it also commented when it is on the next line? 

4 REPLIES 4
LinusH
Tourmaline | Level 20

Why don't you run the code and see?

Data never sleeps
Oligolas
Barite | Level 11

Minimize the question to its simplest form and perform a test run:

proc sql;
   select *
   from sashelp.class
   ;
   *where 1 eq 2
   and 2 eq 3;
quit;
________________________

- Cheers -

ballardw
Super User

Since you are showing code with macro variables there is a question about is this step in the middle of a macro (%macro/%mend; code block) or not.

 

You can get odd results using statement comments inside macros depending on your intent.

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
  • 4 replies
  • 1138 views
  • 4 likes
  • 5 in conversation