BookmarkSubscribeRSS Feed
happy_mouth
Obsidian | Level 7

Hi there,

 

I found red color for the keywords discreteattrmap, value, enddiscreteattrmap, and discreteattrvar, used with proc template and the begingraph statement. 

 

The full code runs fine.

 

I'm using SAS 9.4, EG 7.12.

 

 

Thanks,

David

 

proc template;
define statgraph summry;
begingraph / designwidth=750 designheight=800 border=false;

  discreteattrmap name="My_Map" / ignorecase=true;
  value "First"/fillattrs=GraphData1(color=CXC4D79B);
  value "Second"/fillattrs=GraphData2(color=CX7E9952);
  value "Third"/fillattrs=GraphData2(color=CX4F6228);
  enddiscreteattrmap;

  discreteattrvar attrvar=Scenario var=Scenario attrmap="My_Map";
DerekD_WF
Obsidian | Level 7

Was there ever a resolution for this problem? I still have keywords like WHERE that are showing as undefined/red font in the enhanced editor within SAS Enterprise Guide 7.15

Rick_SAS
SAS Super FREQ

As far as I know, the SAS team that supports the EG and SAS Studio interfaces try to resolve these issues as they are reported. Thanks for contributing statements or options that are not coded correctly. 

SASKiwi
PROC Star

Not a problem in EG 8.2, which I'm using currently, or earlier releases of EG 8,

VDR
Calcite | Level 5 VDR
Calcite | Level 5

The "MNAR" statement in Proc MI is red in my editor(SAS v9.4 M6). Code runs fine and creates dataset as expected. 

 

VDR_0-1598454568292.png

 

jimbarbour
Meteorite | Level 14

@Rick_SAS,

 

When I code a "Not" in front of a macro function, the "Not" is colorized in red.  The code runs fine.  Note that the IF statement is outside a macro which is valid as of 9.4 M5 if I recall correctly.  IF statements inside a Macro-Mend structure do not have this issue.

Red_NOT_Macro_Function_2020-09-03_15-17-08.jpg

 

I'm running SAS EG 8.2 Update 1, 32 bit, with SAS 9.4 M6 on a Windows 2016 server.

 

Regards,

 

Jim

 

P.S.  To be clear, all of the following will have the NOT colorized in red:

%if	NOT	%Sky_Is_OK	%then
	%do;
		%PUT	ERROR:  The sky is falling 1;
	%end;

%if	NOT	&Sky_Is_OK	%then
	%do;
		%PUT	ERROR:  The sky is falling 2;
	%end;

%if	NOT	0	%then
	%do;
		%PUT	ERROR:  The sky is falling 3;
	%end;
jimbarbour
Meteorite | Level 14

@Rick_SAS,

 

In addition to what I said in my last post, the NOT will also display (incorrectly) in red in SAS Display Manager.  For example, the "NOT" in the below macro if statement will be displayed in red when used in open code.  In other words, my previous post applies equally to both Enterprise Guide 8.2 and Display Manager.

%IF	NOT	&False	%THEN
	%DO;
		%PUT	It is true;
	%END;

Interestingly, if the condition is enclosed in parenthesis, the colorization is correct (in Enterprise Guide and Display Manager):

%IF	NOT	(&False)	%THEN
	%DO;
		%PUT	It is true;
	%END;

Regards,

 

Jim

 

P.S.  I am running SAS 9.4 M6, Enterprise Guide 8.2 Update 1 (8.2.1.1223) (32-bit), and Display Manager for Windows Server 2016

jimbarbour
Meteorite | Level 14

Hi, @Rick_SAS,

 

I've got another one for you.  This one is a little oddball; see what you think:

 

PROC	SQL;
	CONNECT	TO	ODBC	AS	Cstn_DW	(DSN=Cornerstone_PRD_DW UID="&cstnID." Pwd="&cstnPW.");

	CREATE TABLE	A_MBR_CURR_SRVC_POP			AS	
		SELECT	*	FROM	CONNECTION	TO	Cstn_DW	(
			SELECT
					MBR_SRVC_POP_CD
					,MBR_SRVC_POP_IND
				FROM	cas20_dw.A_MBR_CURR_SRVC_POP
				WHERE	&whereclients
				%IF	%BQUOTE(&Limit)	^=	%BQUOTE()	%THEN
					%DO;
						AND	RowNum	<=	&Limit
					%END;
				;);
	DISCONNECT	FROM	Cstn_DW;
QUIT;

 

 

In the above code in SAS EG 8.2, the "AND" in "AND RowNum <= &Limit" is highlighted in red.  The code runs just fine.  If the %IF construct is removed, the colorization is fine but if the code is conditionally included (as shown above), the "AND" is colored red.

 

The above is also true in SAS Display Manager.

 

Jim

jimbarbour
Meteorite | Level 14

Hi, @Rick_SAS,

 

I found another one, similar to the last.  Are you still interested in finding these?  Maybe you could click on "like" if you don't have time to acknowledge via a reply?  I'm happy to report if anyone is actually going to read the reports.

 

Here's my latest, similar to my previous.  If variables are conditionally included in a KEEP list on a dataset by an in-line macro IF, the first variable in the %DO %END block is mis-colorized in red as is the first variable following the %END.

 

This colorization occurs in both EG 8.2 and SAS Display Manager for Win Server 2016.

 

Here's the code:

DATA	Rx_Period_Evaluated	(KEEP=ID 
			%IF	%UPCASE(&Extended_Data)	=	YES	%THEN
				%DO;
					A_Start_Date A_End_Date B_Start_Date B_End_Date 
				%END;
			Drug_Date Both)
	ID_Table(KEEP=ID)
	A_Dates	(KEEP=ID Drug_Date Start_Taking_Date Last_Taking_Date)
	B_Dates	(KEEP=ID Drug_Date Start_Taking_Date Last_Taking_Date)
	;

 

Here's what it looks like on my screen:

jimbarbour_0-1601587935601.png

 

Jim

evelien4C
Calcite | Level 5

I have another one:

 

proc freq data=table_test;
format _CHAR_ $missfmt.;
tables _CHAR_ /missing missprint ;
run;
DebbiBJ
Obsidian | Level 7

DebbiBJ_0-1607373081564.png

Interestingly, the red went away when I deleted the title.

rapunzelle13
Fluorite | Level 6
  /* reset COUNT_DISTINCTTotal2 as we begin a new group*/
    CALL MISSING(COUNT_DISTINCTTotal2, PCT_TOTALTotal2);

in a PROC REPORT : CALL is RED and MISSING is black. Code still seems to work ok. 

SASKiwi
PROC Star

I guess the moral of this long saga is don't totally rely on SAS editor colour coding as it is not entirely foolproof. But I'm sure you knew that anyway...

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats