data have;
input num1 num2;
datalines;
1 2
4 3
7 9
11 10
;
run;
output
num1 num2 num3
1 2 2
4 3 4
7 9 9
11 10 11
@aanan1417 wrote:
num3 should have bigger value from num1 or num2
data want;
set have;
num3=max(num1,num2);
run;
Please explain further what you are doing. What is the logic that takes the input data in data set named HAVE and produces the output?
num3 should have bigger value from num1 or num2
@aanan1417 wrote:
num3 should have bigger value from num1 or num2
data want;
set have;
num3=max(num1,num2);
run;
Have a look at the documentation of the max function: https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.4/lefunctionsref/n00bjr4jof59pwn1bfzk9f5i0ujr.h...
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.