BookmarkSubscribeRSS Feed
Filipvdr
Pyrite | Level 9
hello, this compute block works on 9.2 but generates errors on 9.1

compute dpHold ;
if dpHold eq '' then
dpHold = ExecBy;
if upcase(dpHold) IN ('DEVINP','ENGINP') then
call define (_row_,'STYLE','style={color=#CD5916}');
else if upcase(dpHold) IN ('CUST','PROINP','EXPINP') then
call define (_row_,'STYLE','style={color=#ED1941}');
endcomp;

ERROR:

ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: The above message was for the following by-group:
LOT_ID=AL100418
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: The above message was for the following by-group:
LOT_ID=AL100436
ERROR 180-322: Statement is not valid or it is used out of proper
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
Actually, the error is coming for a BY group, so it's possible that the error is not in the COMPUTE block. If you are trying to use a BY variable in a COMPUTE block, then it MUST be in your COLUMN statement. I can't think of anything else. You might try changing the color to CXCD5916 (with CX instead of #) -- but I think HTML color names also worked in SAS 9.1.

I no longer have SAS 9.1 to test on. You might want to open a track with Tech Support as they could look at your data and ALL your code and test on SAS 9.1.

cynthia
Filipvdr
Pyrite | Level 9
i doubt this

this runs without errors, when i uncomment i get these errors..
my by variable is an other variable

compute dpHold ;
if dpHold eq "" then
dpHold = ExecBy;
/*
if upcase(dpHold) eq 'DEVINP' then
call define (_row_,"STYLE","style={color=#CD5916}");

else if upcase(dpHold) IN ("CUST","PROINP","EXPINP") then
call define (_row_,"STYLE","style={color=#ED1941}");
*/
endcomp;
Cynthia_sas
SAS Super FREQ
Hi:
I thought it as an unlilkely reason, but worth mentioning, since you didn't show all your code and since the error message explicitly mentioned the BY group.

Still the same recommendation, though --if the code works on 9.2, but not on 9.1, then you need to open a track with Tech Support.

cynthia
Filipvdr
Pyrite | Level 9
this is my full code:


ods html file=_webout (title="Prio Lot Report") stylesheet=(URL="http://imecwww.imec.be/~osp/fab300/test/ImecStyle.css");
ods listing close;
ods escapechar='^';
/* title */
/*ods text="Prio Lot Report";*/
options nobyline;
proc report data=prio_table nowd style(report) = [rules=groups cellspacing=0pt];
/* Each variable you want to display or to highlight has to be in the column section */
column Lot_ID Ent_State OperSeq OpersAway Facility Operation ToolAndState OperParValue nrWafers oCycleTime
ExecBy OperOwner dpHold Holdnote ProcessEngineer Holdcode BatchEngineer Route Datim DaysOper oper24 oper48 Program Priority PriorityReason TimeCritical;
/* Start Defining Columns */
define Lot_id / display noprint;
define Ent_State / display noprint ;
define OperSeq / display 'Seq';
define OpersAway / display 'Away' ;
define Facility / display noprint;
define Operation / display;
define ToolAndState / display 'Tool';
define OperParValue / display ;
define nrWafers / display 'Wafers';
define oCycleTime/ display;
define ExecBy/ display noprint;
define OperOwner / display ;
define DpHold / display ;
define HoldNote / noprint ;
define ProcessEngineer / noprint ;
define HoldCode / noprint ;
define BatchEngineer / noprint ;
define Route / noprint ;
define Datim / display noprint ;
define DaysOper / display noprint ;
define oper24 / display noprint ;
define oper48 / display noprint ;
define priority / noprint;
define program / noprint;
define TimeCritical / noprint;
define PriorityReason / noprint;
/* Byvariable */
by lot_id;
/* Text before each table */
compute before _page_ / style={just=l};
text1 = 'Lot_Id: ' || '^{style[url="http://wiksas.imec.be:8080/SASStoredProcess/do?_program=/Samples/SP_ShortTermScheduleFast&lotnumber='|| strip(Lot_Id) || '"]' || strip(Lot_Id) || '}(' || strip(Priority) || ") Facility:" || strip(Facility) || "" ;
text2 = "Priority Reason:" || strip(PriorityReason) ;
text3 = "Holdcode: " || strip(Holdcode) || " Holdnote: " || strip(Holdnote) || "" ;
text4 = "Route: " || strip(route) || " ProcessEngineer: " || strip(ProcessEngineer) || " BatchEngineer: " || strip(BatchEngineer) || "" ;
text5= "Days At Operation: " || strip(put(DaysOper,6.2)) || " Arrival Date: "|| strip(put(Datim,datetime21.)) || "" ;
text6= "Program:" || strip(Program) || "" ;
text7= "Operations Last 24hrs: " || strip(put(oper24,6.2)) || " Last 48hrs: " || strip(put(oper48,6.2)) || "" ;
line text1 $;
line text2 $;
line text3 $;
line text4 $;
line text5 $;
line text6 $;
line text7 $;
endcomp;
/* Defining rules for variables */
/*
compute ToolAndState;
if upcase(ENT_STATE) eq ('RESERVED') then
call define (_col_,'STYLE','style={color=#143F90}');
if upcase(ENT_STATE) IN ('EQFAIL','IDLE_ERROR') then
call define (_col_,'STYLE','style={color=#ED1941}');
if upcase(ENT_STATE) in ('SPC_TEST','SET_UP') then
call define (_col_,'STYLE','style={color=#0089CE}');
if upcase(ENT_STATE) eq 'IN_REPAIR' then
call define (_col_,'STYLE','style={color=#00A84F}');
endcomp;
*/

compute dpHold ;
if dpHold eq "" then
dpHold = ExecBy;
/*
if upcase(dpHold) eq 'DEVINP' then
call define (_row_,"STYLE","style={color=#CD5916}");

else if upcase(dpHold) IN ("CUST","PROINP","EXPINP") then
call define (_row_,"STYLE","style={color=#ED1941}");
*/
endcomp;

/*
compute Operation ;
if substr(Operation,1,3) in ('701','702','703') then
call define (_row_,'STYLE','style={color=#ED1941}');
if substr(Operation,1,3) in ('701','702','703') then
call define (_row_,'STYLE','style={color=#ED1941}');
endcomp;
*/
run;
ods html close;
Filipvdr
Pyrite | Level 9
it seems that when i'm changing the style attribute from color to background, it works. But my user wants only text colored, any help?

EDIT: foreground color works :-) Message was edited by: Filipvdr
Cynthia_sas
SAS Super FREQ
Oh, sigh, I should have thought of that! On 9.1, COLOR was not implemented yet, but FOREGROUND was. You can figure out which attributes are the 9.1 attributes, by checking here --
http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/a002972093.htm

generally the "alias" was the attribute name used in 9.1 -- for example:
9.2 / 9.1
COLOR / FOREGROUND
FONTSIZE / FONT_SIZE

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 6 replies
  • 969 views
  • 0 likes
  • 2 in conversation