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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 15 replies
  • 1742 views
  • 0 likes
  • 3 in conversation