Hi,
I have trouble running this. I would like values for x.
data A;
y=1 to 200;
do i = 1 to 5 while (y-i>0);
x=(y-i)*3;
output;
end;
Thanks!
I am not sure what is the output you seeking is look like exactly ;
But maybe this is what you want
data A;
do y=1 to 200;
do i = 1 to 5 while (y-i>0);
x=(y-i)*3;
output;
end;
end;
run;
So you will have two loops one for y and the other for i
and each loop should end by END; statment.
Then the above code is what you want.
Perhaps your loops should begin like this:
do y=1 to 200;
do i = 1 to y-1;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: