BookmarkSubscribeRSS Feed

The where functions are perfectly valid so why red?

 

proc tabulate data=lib.test;

class period_end;

tables period_end;

where period_end > '01jan19'd;

run;

proc freq data=lib.test;

tables period_end;

where period_end > '01jan19'd;

run;

8 Comments
Quentin
Super User

I'm not seeing this in Display Manager SAS 9.4M4 or Enterprise Guide 7.13.  Which version of EG are seeing this incorrect syntax highlighting?

KentL
Obsidian | Level 7

agreed - I'm also not seeing this in SAS EG.  Maybe first contacting SAS support?

Reeza
Super User

@Nadz you should provide your version of SAS and EG as well. You can find this information by running the following:

 

*what is installed;
proc product_status;
run;


*what is licensed;
proc setinit;
run;
Tom
Super User
Super User

Maybe SAS has built advanced AI into their color coding algorithms and it has figured out you have mistakenly used two digit years in your date literals?

 

Seriously why does it matter that much?  Perhaps you are just running an old version of whatever editor you are using and in that version they decided the keyword WHERE should always be displayed in red.  Perhaps you even did it yourself and just forgot you changed that editor setting?

 

Remember that the color coding is just the editor's attempt to mimic how SAS will interpret your code, but it is NOT actually how SAS will interpret your code.  If you have concerns about syntax then refer to the documentation.  The real test is what the SAS log says when you run the code through SAS itself.  

Nadz
Fluorite | Level 6

For Base SAS Software ...
   Custom version information: 9.4_M3
   Image version information: 9.04.01M3P060315

For SAS/STAT ...
   Custom version information: 14.1....

 

Version of SAS EG doesn't come up on product status but:

7.15 (7.100.5.5850) (64-bit)

 

NOTE: PROCEDURE SETINIT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
     
Original site validation data
Current version: 9.04.01M3P062415

Nadz
Fluorite | Level 6

@Tom it doesn't impact my code as it runs with no issues whatsoever. But we have lots of new analysts learning to code for the first time, and it will throw a new programmer who won't run something if it has red in it and will assume they've done something wrong.

 

It's also not just on my PC either but across the organisation.

 

Sounds like it's something to do with our install though if other people do not have this issue.

PhilC
Rhodochrosite | Level 12

I'm surprised no one complained before, but I noticed it.  -- annoying for sure--  but it's fixed in EG 8!

ChrisNZ
Tourmaline | Level 20
The SAS and the EG color parsers gets many things wrong. It'd be nice to have a reliable defects repository for the missed keywords to see what's outstanding and what's fixed in the successive versions.