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!

 

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 445 views
  • 2 likes
  • 2 in conversation