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-2024.png

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.

 

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.

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
  • 1340 views
  • 0 likes
  • 3 in conversation