Hi to all,
Need kind mind about this :
Datahave :
input A @@;
cards;
1441.47 1465.15 1441.36 1360.16 1424.37 1387.12 1346.09 1333.36
Datawant :
input A B;
cards;
1441.47 1441.47
1465.15 1465.15
1441.36 1465.15
1360.16 1465.15
1424.37 1465.15
1387.12 1465.15
1346.09 1465.15
1333.36 1465.15
Where B is computed as : B= max ($A$1: A_n_) that is most greatest value of A since the first line.
Thanks.
B Regards
As long as your data set does not yet contain B:
data want;
set have;
retain b;
if a > b then b = a;
run;
What have you tried so far?
Posting code using the running-man-icon is recommended to preserve formatting and white-space.
You will want to look-up the retain statement.
As long as your data set does not yet contain B:
data want;
set have;
retain b;
if a > b then b = a;
run;
Thanks for that ! It is a possibility !
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.