title1 'June Billing'; /*#1*/ data work.junefee; /*#2*/ set cert.admitjune; where age>39; run; /*#3*/ proc print data=work.junefee; /*#4*/ run;
1 | The TITLE statement is a global statement. Global statements are typically outside steps and do not require a RUN statement. |
2 | The DATA step creates a new SAS data set named Work.JuneFee. The SET statement reads in the data from Cert.AdmitJune. The new data set contains only those observations whose value for Age is greater than 39. |
3 | If a RUN or QUIT statement is not used at the end of a step, SAS assumes that the beginning of a new step implies the end of the previous step. If a RUN or QUIT statement is not used at the end of the last step in a program, SAS Studio and SAS Enterprise Guide automatically submit a RUN and QUIT statement after the submitted code. |
4 | The PROC PRINT step prints a listing of the new SAS data set. A PROC step begins with a PROC statement, which begins with the keyword PROC. |
data work.admit2; /*#1*/ set cert.admit; where age>39; proc print data=work.admit2; /*#2*/ run; /*#3*/
1 | The DATA step creates a new SAS data set named Work.Admit2 by reading Cert.Admit. The DATA statement is the beginning of the new step. The SET statement is used to read data. The WHERE statement conditionally reads only the observations where the value of the variable Age is greater than 39. |
2 | The PROC PRINT step prints the new SAS data set named Work.Admit2. The PROC PRINT statement serves as a step boundary in this example because a RUN statement was not used at the end of the DATA step. The PROC step also implies the end of the DATA step. |
3 | The RUN statement ends the PROC step. |
5 data work.admit2; 6 set cert.admit; 7 where age>39; 8 run; NOTE: There were 10 observations read from the data set CERT.ADMIT. WHERE age>39; NOTE: The data set WORK.ADMIT2 has 10 observations and 9 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 9 proc print data=work.admit2; NOTE: Writing HTML Body file: sashtml.htm 10 run; NOTE: There were 10 observations read from the data set WORK.ADMIT2. NOTE: PROCEDURE PRINT used (Total process time): real time 0.35 seconds cpu time 0.24 seconds
data work.admit2; set cert.admit; where age>39; run;
data work.admit2;
set cert.admit;
where age>39;
run;
proc print data=work.admit2;
run;
proc freq data=sashelp.cars; table origin*DriveTrain; run;
proc sort data=cert.admit; by sex; run;
11 proc sort data=cert.admit; 12 by sex; 13 run; NOTE: There were 21 observations read from the data set CERT.ADMIT. NOTE: The data set CERT.ADMIT has 21 observations and 9 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.01 seconds cpu time 0.00 seconds