10-26-2016 09:03 AM
I am new to SAS programming. I am finding way to solve the following problem.
The existing programming prints 2 to 15 levels output. If I would like to print only the levels between a particular value (say 8) and 15, how do I achieve it using do or do-while loops.
Current sample output:
x_2 = x_1+(((1)/15)*y;
x_15 = x_1+(((14)/15)*y);
10-26-2016 09:45 AM
Here's one way:
value blanks low-<5, 8 <- high = ' ';
proc print data=have;
var x_2 - x_15;
format x_2 - x_15 blanks.;
10-26-2016 09:52 AM
Thanks for your reply. So does that mean that if I specify level 8, it would print only X_9 to X_15? Also, can't it be done using loops? say a do or do-while loop. I am trying to understand the solution you gave.
10-26-2016 09:57 AM
This solution prints all the variables, using PROC PRINT. For any value that is out of range, it prints a blank instead of the actual value.
If you don't want to see even those blanks, it takes more complex programming and results in uglier output. But it can easily be done if that is a better outcome.