Data visualization with SAS programming

Easy Beginner question on KEYLEGEND

Reply
Occasional Contributor
Posts: 5

Easy Beginner question on KEYLEGEND

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

Attachment
Super Contributor
Posts: 490

Re: Easy Beginner question on KEYLEGEND

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.

Occasional Contributor
Posts: 5

Re: Easy Beginner question on KEYLEGEND

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.

SAS Super FREQ
Posts: 8,647

Re: Easy Beginner question on KEYLEGEND

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

Grand Advisor
Posts: 9,748

Re: Easy Beginner question on KEYLEGEND

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.

Occasional Contributor
Posts: 5

Re: Easy Beginner question on KEYLEGEND

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.

Post a Question
Discussion Stats
  • 5 replies
  • 438 views
  • 0 likes
  • 4 in conversation