BookmarkSubscribeRSS Feed
Reeza
Super User
Max is a function, that takes the maximum of the two arguments.

In this case for every row, it evaluates to the maximum of 815 and the value of X1 variable.

If you don't know what the parts mean, break out the code so you can examine it line by line. Here's an example. Look at the values that the check_flag's take over your data set, specifically what the start and ending for the do loop would be, and if they're what you intended.

data sasuser.ggp2;
set sasuser.ggp1;
array _v{*} v:;
if x1>1 then check_flag1=1;
else check_flag1=0;
check_flag2=max(815, x1);
check_flag3=min(dim(_v), xx1);
check_flag4=dim(_v);

run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 15 replies
  • 3024 views
  • 0 likes
  • 3 in conversation