Dear All,
I have a data file showed below:
ID a1 b1 c1
1 23 35 61
2 76 71 10
3 90 60
4 31 50
5 70 42
6 35 67 89
I want create a new variable 'd1' with highest number from a1, b1, c1.
Thanks for your help.
data have;
input ID a1 b1 c1;
d1=max(of a1--c1);
datalines;
1 23 35 61
2 76 71 10
3 90 . 60
4 . 31 50
5 70 42 .
6 35 67 89
;
max()
data have;
input ID a1 b1 c1;
d1=max(of a1--c1);
datalines;
1 23 35 61
2 76 71 10
3 90 . 60
4 . 31 50
5 70 42 .
6 35 67 89
;
Hi stat@sas and Linush,
Thanks so much for your quick response. I appreciate your help.
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.
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.