![]() Chapter Contents |
![]() Previous |
![]() Next |
| OUTPUT |
| Valid: | in a DATA step |
| Category: | Action |
| Type: | Executable |
Syntax |
| OUTPUT<data-set-name(s)>; |
| Without Arguments |
| Arguments |
| Details |
When you use the MODIFY statement with the OUTPUT statement, the REMOVE and REPLACE statements override the implicit write action at the end of each DATA step iteration. See Comparisons for more information. If both the OUTPUT statement and a REPLACE or REMOVE statement execute on a given observation, perform the output action last to keep the position of the observation pointer correct.
| Comparisons |
| Examples |
These examples show how you can use an OUTPUT statement:
/* writes the current observation */ /* to a SAS data set */ output;
/* writes the current observation */ /* when a condition is true */ if deptcode gt 2000 then output;
/* writes an observation to data */ /* set MARKUP when the PHONE */ /* value is missing */ if phone=. then output markup;
data response(drop=time1-time3); set sulfa; time=time1; output; time=time2; output; time=time3; output; run;
data ozone oxides;
infile file-specification;
input city $ 1-15 date date7.
chemical $ 26-27 ppm 29-30;
if chemical='O3' then output ozone;
else output oxides;
run;
data discards;
set gadgets;
drop defects;
reps+1;
if reps=1 then total=0;
total+defects;
if reps=10 then do;
output;
stop;
end;
run;
| See Also |
Statements:
|
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.