Help using Base SAS procedures

Summary table based on PROC CONTENTS - need to add N and NMISS

Reply
Contributor
Posts: 62

Summary table based on PROC CONTENTS - need to add N and NMISS

Hi,

I'm trying to produce a brief but comprehensive report on tables extracted from a database with SAS, for delivery to a third party for statistical analysis. The table below produced with PROC CONTENTS is just the sort of thing I'm aiming for, but there are two columns I'd like to add - N and NMISS for every variable (character, numeric or date).

Can anyone help with this? I'm running 9.2 on Windows XP.

Thanks in advance,

Norman.

Here is a sample of a table - sorry about the formatting; the columns align in my document!

TT01 Form

The CONTENTS Procedure

Variables in Creation Order
# Variable Type Len Format Informat Label
1 TSTAMP Num 8 DATE9. DATE9. TSTAMP
2 TT Char 50 $50. $50. TT
3 PTIDENT Char 50 $50. $50. PTIDENT
4 PTTRIALID Char 50 $50. $50. PTTRIALID
5 UK Num 8 11. 11. UK
6 INCRIT1 Num 8 11. 11. INCRIT1
7 INCRIT2 Num 8 11. 11. INCRIT2
8 INCRIT3 Num 8 11. 11. INCRIT3
9 INCRIT4 Num 8 11. 11. INCRIT4
10 INCRIT5 Num 8 11. 11. INCRIT5
11 EXCRIT1 Num 8 11. 11. EXCRIT1
12 EXCRIT2 Num 8 11. 11. EXCRIT2
13 EXCRIT3 Num 8 11. 11. EXCRIT3
14 EXCRIT4 Num 8 11. 11. EXCRIT4
15 EXCRIT5 Num 8 11. 11. EXCRIT5
16 PSNAME1 Char 50 $50. $50. PSNAME1
17 PFNAME1 Char 50 $50. $50. PFNAME1
18 HOSPNO1 Char 50 $50. $50. HOSPNO1
19 DOB1 Num 8 DATE9. DATE9. DOB1
20 DPTINFO Num 8 DATE9. DATE9. DPTINFO
...etc.
Norman.
SAS 9.4 (TS1M0) X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation

Valued Guide
Posts: 2,108

Re: Summary table based on PROC CONTENTS - need to add N and NMISS

SAS doesn't do that in one procedure. You are going to have to splice together the information from multiple procedures. You can use the ODS datasets to output the data and then merge it back together. You may actually find the Enterprise Guide "Characterize data" task gives you the additional information that you need; the statisticians will appreciate the additional distribution information from that task.
Ask a Question
Discussion stats
  • 1 reply
  • 64 views
  • 0 likes
  • 2 in conversation