LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 14 Dec 2007 13:48:01 -0800
Reply-To:   Bill McKirgan <Bill.McKirgan@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Bill McKirgan <Bill.McKirgan@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: on listing variables in a file in a concise way
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

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,


Back to: Top of message | Previous page | Main SAS-L page