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;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1616 views
  • 0 likes
  • 3 in conversation