Selecting Variables

The PROC PRINT Step

By default, a PROC PRINT step lists all the variables in a data set. You can select variables and control the order in which they appear by using a VAR statement in your PROC PRINT step.
Syntax, VAR statement:
VAR variable(s);
variable(s) is one or more variable names, separated by blanks.
For example, the following VAR statement specifies that only the variables Age, Height, Weight, and Fee be printed, in that order:
proc print data=clinic.admit;
   var age height weight fee; 
run;
The procedure output from the PROC PRINT step with the VAR statement lists only the values for those variables.
Figure 5.2 PRINT Procedure Output
Procedure Output
In addition to selecting variables, you can suppress observation numbers.

Removing the OBS Column

To remove the Obs column, specify the NOOBS option in the PROC PRINT statement.
proc print data=work.example noobs;
   var age height weight fee; 
run;
Figure 5.3 PRINT Procedure Output with No Observation Numbers
Procedure Output with No Observation Numbers
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.136.226