Selecting Variables

The VAR Statement

By default, PROC PRINT 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.
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=cert.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 6.2 PRINT Procedure Output
Procedure Output

Removing the OBS Column

In addition to selecting variables, you can suppress observation numbers.
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 6.3 PRINT Procedure Output with No Observation Numbers
Procedure Output with No Observation Numbers
Last updated: August 23, 2018
..................Content has been hidden....................

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