BookmarkSubscribeRSS Feed
Francisco
Calcite | Level 5

Hi. I'm new with SAS and I have a problem with EG 5.1. I need Update a Field, but conditioning another field. For example:

 

AMOUNT SITUATION

100        

200

530

 

When "AMOUNT" <500 , then UPDATE field "SITUATION" with the char "Menores", and if AMOUNT >=500, then UPDATE with the char "Mayores".

 

I tried, but I couldn't fix it. Is possible makei without a code? (just using the GUI of EG)

 

Thanks in advanced.

1 REPLY 1
Reeza
Super User
You can use Query Builder with a computed column. Use either advanced with a CASE statement or a variable RECODE. If you're going through the point and click the RECODE option may be easier for you.

I don't know think EG supports updates in place, but it looks like a new variable anyways. Otherwise if you really need to only update the table, you may want to write a data step.

data want;
set want;
if amound>500 then situation='Menores';
else if amount>=500 then situation='Mayores';
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1170 views
  • 0 likes
  • 2 in conversation