The MCHP SAS MANUAL - PROC PRINT (Output)

         

Home    Contents

GENERAL GUIDELINES:
Windows in SAS
File management

The SAS Program
Program syntax
Debugging tips


 USING SAS PROGRAMMING TO: 
   
1. Prepare the data set 
   Types of data 
   Example programs    
    
2. View the data
   SAS Procedures
  
3. Explore the data  
   Numeric statistics    
   Frequency tables    
    
4. Manipulate the data  
   Basic techniques    
   New variables
  
5. Adding Variables and 
Observations to Data Sets
   The SET Statement
   The MERGE Statement

6. Data Processing
   ARRAY Statement
   Do Loops
   By-Group Processing
   RETAIN Statement
  
NON-PROGRAMMING 
      Alternatives

 
SAMPLE DATA SETS: 
 Height/weight
 Height/weight/region
 Simulated clinical data 
 Simulated Manitoba Health 
    

PROC PRINT - Output

                     PROC PRINT: Example 1                     3
             No keywords specified except for TITLE
                                  08:54 Wednesday, June 30, 1999

      Obs    name          sex    age    height    weight

        1    Aubrey         M      41      74        170
        2    Ron            M      42      68        166
        3    Carl           M      32      70        155
        4    Antonio        M      39      72        167
        5    Deborah        F      30      66        124
        6    Jacqueline     F      33      66        115
        7    Helen          F      26      64        121
        8    David          M      30      71        158
        9    James          M      53      72        175
       10    Michael        M      32      69        143
       11    Ruth           F      47      69        139
       12    Joel           M      34      72        163
       13    Donna          F      23      62         98
       14    Roger          M      36      75        160
       15    Yao            M       .      70        145
       16    Elizabeth      F      31      67        135
       17    Tim            M      29      71        176
       18    Susan          F      28      65        131
                     PROC PRINT: Example 2                     4
     Use of OBS=, LABEL, ID, VAR, SUM, and FORMAT keywords
                                  08:54 Wednesday, June 30, 1999

                         Gender                Weight
          Name of          of        Age of      in
          student       student     student    pounds

          Aubrey        M.Male         41        170
          Ron           M.Male         42        166
          Carl          M.Male         32        155
          Antonio       M.Male         39        167
          Deborah       F.Female       30        124
          Jacqueline    F.Female       33        115
          Helen         F.Female       26        121
          David         M.Male         30        158
          James         M.Male         53        175
          Michael       M.Male         32        143
                                               ======
                                                1494
                     PROC PRINT:  Example 3                    5
              Where the data set is sorted by name
                                  08:54 Wednesday, June 30, 1999

                    name          sex    age

                    Antonio        M      39
                    Aubrey         M      41
                    Carl           M      32
                    David          M      30
                    Deborah        F      30
                    Donna          F      23
                    Elizabeth      F      31
                    Helen          F      26
                    Jacqueline     F      33
                    James          M      53
                    PROC PRINT:  Example 4                    6
        Where the data set is sorted by descending name
                                  08:54 Wednesday, June 30, 1999

                    name          sex    age

                    Yao            M       .
                    Tim            M      29
                    Susan          F      28
                    Ruth           F      47
                    Ron            M      42
                    Roger          M      36
                    Michael        M      32
                    Joel           M      34
                    James          M      53
                    Jacqueline     F      33
                     PROC PRINT: Example 5                     7
          Where the data set is sorted by sex and age
                                  08:54 Wednesday, June 30, 1999

                    name          sex    age

                    Donna          F      23
                    Helen          F      26
                    Susan          F      28
                    Deborah        F      30
                    Elizabeth      F      31
                    Jacqueline     F      33
                    Ruth           F      47
                    Yao            M       .
                    Tim            M      29
                    David          M      30

Contact: Charles Burchill       Telephone: (204) 789-3429
Manitoba Centre for Health Policy
Department of Community Health Sciences, University of Manitoba
4th floor Brodie Centre
408 - 727 McDermot Avenue
Winnipeg, Manitoba R3E 3P5       Fax: (204) 789-3910
Last modified on Wednesday, 24-Aug-2005 13:52:26 CDT