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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 790 views
  • 0 likes
  • 2 in conversation