Date: Wed, 1 Dec 2004 16:48:24 -0800
Reply-To: cassell.david@EPAMAIL.EPA.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Cassell" <cassell.david@EPAMAIL.EPA.GOV>
Subject: Re: Using Macro Code within a DATA Step Select Statement
In-Reply-To: <200411301915.iAUJFpTh013897@listserv.cc.uga.edu>
Content-type: text/plain; charset=US-ASCII
Jack Clark <jack_clark@HARTE-HANKS.COM> replied:
> I tried to trim a lot of extraneous stuff from the code I posted to
the
> list. If we use what was posted as the example...
>
> I have a variable (cat) with 3 possible values ('G', 'H', 'I'). The
decile
> variable contains values 0-9.
>
> The reason why I am coding all of the dummy variables is because these
are
> fields that are required on a client report. I am using a PROC
SUMMARY
> (with a couple of CLASS variables) to sum the dummy variables once
coded.
> The report is to show the following columns:
>
> # of records where cat=G
> # of records where cat=G and Decile = 0
> # of records where cat=G and Decile = 1
> etc.
>
> # of records where cat=H
> # of records where cat=H and Decile = 0
> # of records where cat=H and Decile = 1
> etc.
>
> # of records where cat=I
> # of records where cat=I and Decile = 0
> # of records where cat=I and Decile = 1
> etc.
>
> If you have a better suggestion, I am certainly interested. FYI - we
do
> not have SAS STAT on the operating system where this production job
will be
> run. Thanks.
Sorry about the SAS/STAT remark. I was envisioning you building dummy
variables for some sort of linear model.
What you are actually doing above looks like a standard PROC SUMMARY
task. I just don't see why you need the dummy variables. PROC SUMMARY
will calculate N (the number of relevant records) if you just give
it CAT and DECILE as your CLASS variables. Then use the PRINTALLTYPES
option to get the summaries by CAT and also by CAT + DECILE in the
same run.
HTH,
David
--
David Cassell, CSC
Cassell.David@epa.gov
Senior computing specialist
mathematical statistician
|