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 (September 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 21 Sep 2001 17:04:16 -0400
Reply-To:     Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject:      Re: ods, Proc Freq, macro variable
Comments: To: John Uebersax <jsuebersax@YAHOO.COM>
Content-Type: text/plain; charset="iso-8859-1"

John,

ODS won't do much for you here. You could use ODS OUTPUT to get the counts you need into an output data set, but you are doing that now.

PROC SQL, on the other hand, offers an extremely elegant solution to your problem:

DATA Temp; DROP N; DO Strata = 1 TO 5; DO N = 1 TO Strata * 10; OUTPUT; END; END; RUN;

PROC SQL NOPRINT; SELECT COUNT(*) INTO :Obscnt1 - :Obscnt5 FROM Temp GROUP BY Strata ORDER BY Strata ; QUIT;

%PUT _USER_;

Mike Rhoads Westat RhoadsM1@Westat.com

-----Original Message----- From: John Uebersax [mailto:jsuebersax@YAHOO.COM] Sent: Friday, September 21, 2001 3:35 PM To: SAS-L@LISTSERV.UGA.EDU Subject: ods, Proc Freq, macro variable

I'd like a simple way to define 5 macro variables that contain the number of observations in each of 5 strata in a dataset.

Is there a neat way to do this using ODS?

Currently I'm using proc freq, outputting the results into a dataset, then using call symput.

I have not used ods much--so please gear any replies accordingly.

---------------------------------------------------------------------------- ---- John Uebersax, PhD (805) 384-7688 Thousand Oaks, California (805) 383-1726 (fax) email: jsuebersax@yahoo.com

Agreement Stats: http://ourworld.compuserve.com/homepages/jsuebersax/agree.htm Latent Structure: http://ourworld.compuserve.com/homepages/jsuebersax Existential Psych: http://members.aol.com/spiritualpsych ---------------------------------------------------------------------------- ----


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