Association of previous roles/experience to job effectiveness as a leader
data diss.prtable;
set diss.prtable;
if instructional_coach = 2 then IC = 1 else IC = 0;
if intervention_specialist = 2 then IS = 1 else IS = 0;
if content_area_coach = 2 then AC = 1 else AC = 0;
if Title_1 = Y then T1 = 1 else T1 = 0;
if Site = Middle then MS = 1 else MS = 0;
if Site = High then HS = 1 else HS = 0;
if Site = K8 then K8 = 1 else K8 = 0;
if Site = Elementary then ES = 1 else ES = 0;
if IC = 1 or IS =1 or AC = 1 then role = 1 else role = 0;
run;
quit;
ERROR 388-185: Expecting an arithmetic operator.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
498 run;
NOTE: Character values have been converted to numeric values at the places given by:
(Line):(Column).
495:31
NOTE: Numeric values have been converted to character values at the places given by:
Thank you
Association of previous roles/experience to job effectiveness as a leader
data diss.prtable;
set diss.prtable;
if instructional_coach = 2 then IC = 1 else IC = 0;
if intervention_specialist = 2 then IS = 1 else IS = 0;
if content_area_coach = 2 then AC = 1 else AC = 0;
if Title_1 = Y then T1 = 1 else T1 = 0;
if Site = Middle then MS = 1 else MS = 0;
if Site = High then HS = 1 else HS = 0;
if Site = K8 then K8 = 1 else K8 = 0;
if Site = Elementary then ES = 1 else ES = 0;
if IC = 1 or IS =1 or AC = 1 then role = 1 else role = 0;
run;
quit;
ERROR 388-185: Expecting an arithmetic operator.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
498 run;
NOTE: Character values have been converted to numeric values at the places given by:
(Line):(Column).
495:31
NOTE: Numeric values have been converted to character values at the places given by:
@gtbash wrote:
Association of previous roles/experience to job effectiveness as a leader
data diss.prtable;
set diss.prtable;
if instructional_coach = 2 then IC = 1 else IC = 0;
if intervention_specialist = 2 then IS = 1 else IS = 0;
if content_area_coach = 2 then AC = 1 else AC = 0;
if Title_1 = Y then T1 = 1 else T1 = 0;
if Site = Middle then MS = 1 else MS = 0;
if Site = High then HS = 1 else HS = 0;
if Site = K8 then K8 = 1 else K8 = 0;
if Site = Elementary then ES = 1 else ES = 0;
if IC = 1 or IS =1 or AC = 1 then role = 1 else role = 0;
run;
quit;
ERROR 388-185: Expecting an arithmetic operator.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
498 run;
NOTE: Character values have been converted to numeric values at the places given by:
(Line):(Column).
495:31
NOTE: Numeric values have been converted to character values at the places given by:
The error you made (in many places), is corrected with red below
if instructional_coach = 2 then IC = 1; else IC = 0;
In the future, please do not show us the log disconnected from the code. Show us the entire log, all of it, for this data step, with nothing chopped out, so we can see the code as it appears in the log, the NOTEs, ERRORs and WARNINGs in the sequence that it all appears in the log.
Thank you
Start here and see if any errors remain:
The ELSE statement is a separate statement.
In every case, the previous IF THEN statement has to end with a semicolon.
I merged the duplicate postings into one post.
The error message in the SAS log will show where the error is. Copy the text from the SAS log and paste into window opened with the Insert Code button (looks like < / > ) to share on the forum.
Here is an example of what the error message will look like:
131 data want; 132 set have; 133 if instructional_coach = 2 then IC = 1 else IC = 0; ---- 388 202 ERROR 388-185: Expecting an arithmetic operator. ERROR 202-322: The option or parameter is not recognized and will be ignored. 134 run;
So the word ELSE is flagged. To SAS it looks like you are trying to set IC to the value :
1 else IC = 0
So it is complaining because there is no operator between the numeric literal 1 and the reference to the variable named ELSE.
You are missing the semi-colon that marks the end of the IF statement. So you have merged the IF and ELSE statements into one statement.
if instructional_coach = 2 then IC = 1;
else IC = 0;
Thank you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.