Search notes:

SAS: proc print

where

data tq84_numbers;

  input
    val     1- 2
    nam  $  4- 9
  ;

datalines;
 1 one
 2 two
 3 three
 4 four
 5 five
 6 six
 7 seven
 8 eight
 9 nine
;


proc print
  data  =   tq84_numbers;

  where val between 3 and 6 or
        val eq      8;

run;
Github repository about-SAS, path: /programming/proc/print/where.sas

data

data tq84_data;
  bar  = 100;
  do i = 1 to 5;

     foo = i * 3;
     bar = bar - foo;
     baz = mean(foo, bar);

     output;
  end;
run;

proc print data=tq84_data;
run;
Github repository about-SAS, path: /programming/proc/print/data.sas

var

data tq84;
  input foo bar $ baz $;
datalines;
1 one eins
4 four vier
2 two zwei
9 nine neun
;


proc print data=tq84;
/* var - Print columns foo and baz only: */
  var foo baz;
run;
Github repository about-SAS, path: /programming/proc/print/var.sas
See also this example, where proc print is instructed to print only numeric or character types variables using the special variable lists _numeric_ and _character_.

title

proc print
  data  = tq84_numbers;
  title "Numbers 1 through 9";
run;
Github repository about-SAS, path: /programming/proc/print/title.sas

See also

proc report
SAS programming: proc

Index