10-30-2017 09:49 AM
That is easy. The EDITOR does not really understand SAS code. It is just an editor.
They have programmed it with some rules that approximate how SAS might interpret the code. That way it can give some color coded HINTS about the meaning of what you have typed. But it really has no idea that SAS code is any different than your mother's meatloaf recipe.
10-30-2017 10:00 AM
10-30-2017 10:19 AM
Personally I would delete everything between the ; on the Proc Tabulate statement and the F in format.
I suspect an invisible character OR something way out to the right on the Proc Tabulate statement that doesn't appear in your snippet.
Of course just to create a "stumper" someone could have customized the keyword lists and applied a non-default color scheme for custom keywords.
10-30-2017 10:35 AM
I appreciate all your suggestions ;-) Sorry to say that are absolutely no hocus pocus in the code. No invisible characters whatsoever.
Just write the few lines and see what happens. The red color is annoying. it simply attracts unnecessary attention. FORMAT is valid statement.
10-30-2017 10:34 AM - edited 10-30-2017 10:38 AM
Most likely it is not seeing the PROC statement as valid.
If I open EG 7.13 and start a new program file with:
proc tabulate ; format xxx ; run;
Then is does not make the FORMAT keyword red.
But if hide the PROC statement then it does since you cannot have a FORMAT statement outside of a DATA or PROC step.
*proc tabulate ; format xxx ; run;
So in this case it looks like EG editor is better at highlighting programs than the Enhanced Editor in Display Manage of SAS 9.4.
You need to look at the code above the PROC TABULATE statement to see what is confusing the editor.
Perhaps your code is in the middle of a macro definition? Or perhaps you actually do have an open comment like in my example?
Or perhaps something changed from 7.13 to 7.15? Open a SAS support ticket.
10-30-2017 10:47 AM
HI Tom, I'm using EG version 7.15. EG 7.12 HF4 does not have this issue.
Open a ticket with SAS support.
The issue might not be with the FORMAT statement, but with something in the first 6 lines that it is now processing differently that it changing the state.
10-30-2017 11:44 AM - edited 10-30-2017 11:46 AM
I typed the exact code you posted into a new program in EG 7.15 and I don't see the issue (red "format" statement). If you post some code that can be pasted into a new program in EG 7.15 to reproduce, I'll be happy to investigate.
I agree with Tom, something in the prior code may be contributing.
10-30-2017 12:04 PM
Hi Casey, That's odd - should be the same. Actually it was one of my "customers" here in Statistics Denmark who notified me that his FORMAT statements now showed up in red in EG 7.15. And I was able to reproduce it with a simple code snippet.
In my Enhanced Editor Settings (tools, options, SAS Programs, Enhanced Editor Options, Appearance) undefined keywords are red. I guess this is the standard. Could you be so kind to check your setting?
10-30-2017 04:27 PM - edited 10-30-2017 04:31 PM
I confirmed my editor option to color undefined keywords red (the default) is set. Also if I rename "format" to something incorrect like "forwat", it is properly colored red.
If you type (or copy/paste) this into a new program in EG 7.15, do you see the problem?
proc tabulate data=sashelp.class; format sex $sexfmt.; class age sex; table age, sex; run;
If so, that is odd. (I'm not sure what would explain the difference we are seeing.) Perhaps we have other different options set. Or maybe a regional difference. Are you running EG in English? What locale is your Windows Regional Settings set to?
10-31-2017 06:01 AM
If I either write or copy/paste your code FORMAT gets red... EG is in English. Regional settings on the terminal server that runs EG is
Well I will send the issue to SAS Tech Support, Copenhagen and see if they can reproduce it. Its not a big deal - just annoying.
Thx to all of you Fellow SAS Champions ;-)
10-31-2017 07:34 AM
Thanks for trying that out Peter. Yeah, Tech Support is probably the best route, so we can track it in our system. If we find a way to reproduce, we'll certainly investigate.
11-08-2017 10:04 AM
UPDATE: SAS Technical Support Copenhagen, Denmark has just informed me that Global Support was able to reproduce the problem - defect S1378007. It will be taken care of in a future Hotfix for EG 7.15.