| Date: | Wed, 9 Feb 2005 17:59:26 -0800 |
| Reply-To: | Dennis Diskin <diskin@SNET.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Dennis Diskin <diskin@SNET.NET> |
| Subject: | Re: proc freq - number of vars I need to cross will vary |
|
| In-Reply-To: | <1107986427.864970.194930@f14g2000cwb.googlegroups.com> |
| Content-Type: | text/plain; charset=us-ascii |
|---|
Jared,
What do you have against macros?
Assuming that you want all the variables starting with techdx_ and that there are no extraneous one, then you could build the cross list by: (Untested code)
proc sql noprint;
select name into :cross separated by '*'
from sashelp.vcolumn where libname eq 'WORK'
and memname eq 'MYDATA'
and upcase(substr(name,1,7)) eq 'TECHDX_'
;
quit;
%put ✗
HTH,
Dennis Diskin
Jared <jaredhellman@GMAIL.COM> wrote:
Hi all, I was wondering if there was an easy way to set up a proc freq
(without using a macro) which crosses a varying number of variables.
Here's the setup to show you what I mean...
I have a dataset which will have a varying number of variables:
techdx_1 techdx_2 techdx_3 . . . techdx_N
The macro variable NUMDX will hold the number N
I want to cross all the techdx variables in a single table in a proc
freq. I tried
proc freq data=mydata;
tables techdx_1-techdx_&NUMDX;
run;
but this creates a table for each techdx variable. Remember I need to
do this without writing a macro if possible.
Thanks
|