Previous Page | Next Page

The DOCUMENT Procedure

Example 4: Listing BY-Group Entries


Procedure features:

LIST statement options:

BYGROUPS

LEVELS

LIST

PROC DOCUMENT statement option:

NAME=

OBTEMPL statement

ODS destinations:

DOCUMENT

LISTING

Procedure output:

PROC DOCUMENT

PROC STANDARD



Program Description

This example shows you how to do these tasks:


Program

 Note about code
options nodate nonumber;
ods document name=mydocument(write);
 Note about code
data score;
   input Student Section Test1-Test3;
   stest1=test1;
   stest2=test2;
   stest3=test3;
   datalines;
238900545 1 94 91 87
254701167 1 95 96 97
238806445 2 91 86 94
999002527 2 80 76 78
263924860 1 92 40 85
459700886 2 75 76 80
416724915 2 66 69 72
999001230 1 82 84 80
242760674 1 75 76 70
990001252 2 51 66 91
;
run;

proc sort data=score;
   by Section Student;
run;
 Note about code
ods listing close;
proc standard mean=80 std=5 out=StndScore print;
 Note about code
   by section student;
   var stest1-stest3;
run;
 Note about code
ods document close;
 Note about code
ods listing;
proc document name=mydocument;
   list/ levels=all bygroups;
   obtempl \Standard#1\ByGroup1#1\Standard#1; 
run;
 Note about code
quit;

Output

Listing of WORK.MyDocument without the BYGROUPS Option Specified

 Note about figure

[Listing of WORK.MyDocument without the BYGROUPS Option Specified]

Listing of WORK.MyDocument with the BYGROUPS Option Specified

 Note about figure

[Listing of WORK.MyDocument with the BYGROUPS Option Specified]

Listing View of the Table Template Associated with PROC STANDARD Output

proc template;
   define table Base.Standard;
      notes "Table template for PROC Standard.";
      column name mean std n label;

      define name;
         header = "Name";
         varname = Name;
         style = RowHeader;
      end;

      define mean;
         header = "Mean";
         format = D12.;
         varname = Mean;
      end;

      define std;
         header = "/Standard/Deviation";
         format = D12.;
         varname = stdDev;
      end;

      define n;
         header = "N";
         format = best.;
      end;

      define label;
         header = "Label";
         varname = Label;
      end;
      required_space = 3;
      byline;
      wrap;
   end;
run;

Previous Page | Next Page | Top of Page