Valid in: | DATA step |
Category: | File-handling |
Type: | Declarative |
You can execute a DATA step without creating a SAS data set. See Creating a Custom Report. For more information, see When Not Creating a Data Set (Form 2) .
SAS creates only one view in a DATA step.
SAS macro variables resolve when the view is created. Use the SYMGET function to delay macro variable resolution until the view is processed.
If you use an ALTER password in creating a stored compiled DATA step program or a DATA step view, an ALTER password is required to execute a DESCRIBE statement.
If you use a READ password in creating a stored compiled DATA step program or a DATA step view, a READ password is required to execute DESCRIBE and EXECUTE statements. If you use an invalid password, SAS will execute the DESCRIBE statement.
The DESCRIBE statement does not execute. |
In batch mode, the EXECUTE statement has no effect. |
In interactive mode, SAS prompts you for a READ password. If the READ password is valid, SAS processes the EXECUTE statement. If it is invalid, SAS does not process the EXECUTE statement. |
data phone_list / view=phone_list (source=encrypt);
set customer_list;
. . .more SAS statements. . .
run;
data testfile / pgm=stored.test_program (alter=sales);
set sales_data;
. . .more SAS statements. . .
run;
data sales; input dept : $10. jan feb mar; datalines; shoes 4344 3555 2666 housewares 3777 4888 7999 appliances 53111 7122 41333 ; data _null_; set sales; qtr1tot=jan+feb+mar; put 'Total Quarterly Sales: ' qtr1tot dollar12.; run;
data sample; input Name $ TotalItems $; datalines; Lin 328 Susan 433 Ken 156 Pat 340 ; proc print data=sample; run;
data employees / pgm=stored.items (alter=klondike); set sample; if TotalItems > 200 then output; run;
6 data _null_ /nesting; 7 do i = 1 to 10; - 719 NOTE 719-185: *** DO begin level 1 ***. 8 do j = 1 to 5; - 719 NOTE 719-185: *** DO begin level 2 ***. 9 put i= j=; 10 end; --- 720 NOTE 720-185: *** DO end level 2 ***. 11 end; --- 720 NOTE 720-185: *** DO end level 1 ***. 12 run;