BookmarkSubscribeRSS Feed
ahirt845
Calcite | Level 5

Very quick question on the KEYLEGEND statement.

Is the KEYLEGEND text always red when you type it into SAS? Since (I thought) red text indicates something isn't right, I'm wondering why it's doing that. It seems to work regardless so I suppose it isn't a big deal, but I wonder why it would be red (I have a minor case of OCD).

I have attached a screenshot to this message. The example is from the SAS help notes.

Thanks!

Alex


keylegend.jpg
5 REPLIES 5
mohamed_zaki
Barite | Level 11

I am using SAS 9.2 and i found that:

If you are using the SAS editor you get this keyword in red.

but if you are using Enterprise Guide you will find it blue as normal.

and you will get in both the same result.

ahirt845
Calcite | Level 5

That's what I've found too. I'm using 9.3.

I wonder why KEYLEGEND is red. It works just fine, but I wonder what the reasoning behind it is.

Cynthia_sas
SAS Super FREQ

Hi:

  Usually when you see red, but the code still works, it means that some syntax didn't make it into the color-coding dictionary. If the code runs correctly then don't worry about it. The color-coding eventually catches up with the word in later releases.

cynthia

ballardw
Super User

If you don't want them to appear as red you can go to Tools> Options> Enhanced Editor Options > General. Click on "User Defined Keywords" and add items there. You user defined keywords will appear in the color and background set in the Appearance tab in the "File elements" window for SAS Program file type.

ahirt845
Calcite | Level 5

When I click "Enhanced Editor" SAS completely freezes up until I have to go into the task manager on my computer and end the program. Does anyone else have this issue or is it just me? Very puzzling, I wonder what's going on.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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