|
The CONTENTS procedure will give you the names, formats, and many
other details. Default output is to list variable names in
alphabetical order, and the VARNUM option will display the variables
in column order from left to right.
Try an ODS TRACE ON; Before a UNIVARIATE to learn the ODS names of
data that can be pulled from UNIVARIATE and routed to other datasets
for more concise reporting. The min max info is in ExtremeObs. You
can get those with ODS SELECT statements .
-- Bill
PS: Here's something I wrote yesterday that does that kind of
thing...
/* __wais_wms_qc_20071213.sas
Use this program to report extreme observations found
in the wais and wms cognitive datsets. Output
reports extreme obs with subject id number (IND_ID) and
folder number, to facilitate location in the files.
Bill McKirgan
12/13/2007
*/
OPTIONS MLOGIC MERROR SYMBOLGEN SOURCE2;
title1 'Data Quality Report';
%macro RUNEM( WHATDATA );
proc contents
noprint
data=cogbat.&WHATDATA.
out= &WHATDATA._contents (keep= name varnum);
proc sort data= &WHATDATA._contents;
by varnum;
run;
data _null_;
set &WHATDATA._contents;
%* delete ID variables and other stuff not needed for this analysis;
if lowcase(name)='ind_id' then delete;
if lowcase(name)='folder' then delete;
file 'c:\temp\vnames.sas';
put name @@;
run;
ODS OUTPUT ExtremeObs = &WHATDATA._ExtremeObs ;
ODS LISTING CLOSE;
proc univariate
data=cogbat.&WHATDATA.;
var
%include 'c:\temp\vnames.sas'; ; %* yes two sems here;
id ind_id folder ;
run;
data &WHATDATA._ExtremeObs ;
set &WHATDATA._ExtremeObs ;
label
varname = "Variable Name"
low = "Low Score"
ind_id_low = "IND_ID of Low Score"
folder_low = "FOLDER of Low Score"
high = "High Score"
ind_id_high= "IND_ID of High Score"
folder_high= "FOLDER of High Score"
;
drop lowobs highobs FOLDER_LOW FOLDER_HIGH;
ODS LISTING;
options pageno=1;
title2 "&WHATDATA extreme scores / observations";
title3 'Variables ordered by appearance in assessment instrument and
final dataset [VARNUM]';
title4 "Output reports the 5 lowest and 5 highest extreme scores for
each variable listed";
PROC PRINT double label uniform
DATA= &WHATDATA._ExtremeObs;
ID VARNAME;
VAR LOW -- IND_ID_HIGH;
RUN;
%mend RUNEM;
%RUNEM(WAIS);
%RUNEM(WMS);
/* Note, above the ODS listing is closed for univariate to suppress
over 200 pages of output
that we don't want to print. This output is redirected to temporary
datsets for proc print.
The listing is then open for the proc print where the output is
consolidated to less than
40 pages of output for each wais or wms quality check analysis.
Thanks Kirk Lafler for the 'Output Delivery System (ODS) tips and
tricks' (MWSUG'07)
*/
On Dec 14, 2:42 pm, sasstud...@gmail.com wrote:
> Hello,
>
> I am working with a file with a large number of variables and I would
> like to create a concise list of all the variables in a file. For
> example,
>
> Name format #obs avg min max std
> var1
> var2
> ...
> var100
>
> Please advise about options of proc univariate or other procedures.
>
> Best regards,
|