| Creating Variables |
| Executing Multiple Statements
Conditionally |
| DO Group Processing
To execute a group of SAS statements as a unit, you can use a DO group. |
General form, DO group:
DO; where
|
You can now revise your DATA step to process these statements
in a DO group rather than two conditional statements.
data finance.newloan;
set finance.records(drop=amount rate);
length Type $ 14;
TotalLoan+payment;
if code='1' then
do;
if months=360 then
type='Fixed Mortgage';
else type='Fixed Other';
end;
else type='Variable';
run;
Let's look at the execution of this DATA step line by line to see how the DO group executes. |
![]() ![]() |
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.