BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gtbash
Fluorite | Level 6

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:

 

1 ACCEPTED SOLUTION

Accepted Solutions
gtbash
Fluorite | Level 6
6 REPLIES 6
gtbash
Fluorite | Level 6

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:

 

PaigeMiller
Diamond | Level 26

@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.

 

 

 

--
Paige Miller
gtbash
Fluorite | Level 6

Thank you

Astounding
PROC Star

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.

Tom
Super User Tom
Super User

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;

 

gtbash
Fluorite | Level 6

Thank you.

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 857 views
  • 2 likes
  • 4 in conversation