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 (April 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 5 Apr 2006 16:44:29 -0700
Reply-To:   tanwan <tanwanzang@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   tanwan <tanwanzang@YAHOO.COM>
Organization:   http://groups.google.com
Subject:   Re: PROC FREQ syntax question
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1115a2b00604051249s55756378y18d5ba9cbc2b1b97@mail.gmail.com>
Content-Type:   text/plain; charset="iso-8859-1"

The following macro will do what you want and more: it should handle any number of variables on the list, NOT only 4.

%macro relist(variableList); %let thend = %sysfunc(countc(&variableList,' ')); %let thend = %eval(&thend+1); %do qq=1 %to &thend; %let v1=%qscan(&variableList, &qq); %do zz = %eval(&qq+1) %to &thend; %let v2=%qscan(&variableList, &zz); &v1 * &v2 %end; %end; %mend relist;

proc freq data=SASHELP.CLASS; tables %relist(AGE HEIGHT NAME WEIGHT) / norow nocol nopercent; run;


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