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

Hi guys, it's me again.

 

You helped me a lot but i have one more question 😄

 

I have the following code:

data Work.test;
      set input;
      value = 0.4* value_input;
      reference_number = if value > 0 then reference_number = 123 else 345;
run;

My data has different positive and negative values in the variable value_input.

The aim should be, that positive values get the reference_number  345 and all other values get the reference_number 123.

 

I get three syntax errors:

1. Missing !,!!, & ...

2. Expecting an arithmetic operator

3. The option or parameter is not recognized and will be ignored

 

Would be great if you could help me

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Hansi_12345
Fluorite | Level 6

I found the solution. 😄

 

data Work.test;
      set input;
      value = 0.4* value_input;
      if value > 0 then reference_number = 123; else reference_number = 345;
run;

Sorry for disturbing you.

 

Have a nice day 😄

 

View solution in original post

2 REPLIES 2
Hansi_12345
Fluorite | Level 6

I found the solution. 😄

 

data Work.test;
      set input;
      value = 0.4* value_input;
      if value > 0 then reference_number = 123; else reference_number = 345;
run;

Sorry for disturbing you.

 

Have a nice day 😄

 

ballardw
Super User

Good for you!