Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Output the Results of a Proc Freq To A SAS Dataset
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
"McKeehen, Gina M."  
View profile  
 More options Dec 23 2008, 2:29 pm
Newsgroups: comp.soft-sys.sas
From: Gina.McKee...@IBX.COM ("McKeehen, Gina M.")
Date: Tue, 23 Dec 2008 14:29:42 -0500
Local: Tues, Dec 23 2008 2:29 pm
Subject: Output the Results of a Proc Freq To A SAS Dataset
Good day Everyone,

If I want to make this an permanent output, to be saved as a separate
file how would I do so?
I have been trying for a few days and having no success. Don't know if a
proc printto or  out= applies here
Or maybe neither does.  I do not want it in my log, just saved
separately on its own.

proc freq data=out.abc ;
  by plan;
  table cnt
        h_cmc
        h_cmc*(clm_dx_1_cd clm_dx_2_cd )
        H_LDLC_SCRN*H_LDLC_LT100
        /list missing;
  title3  "ABC Sample";
  title4  "Sample Detail for 2006";
run;

Thanks,
Gina M McKeehen

CONFIDENTIALITY NOTICE: This E-Mail is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you have received this communication in error, please do not distribute and delete the original message.  Please notify the sender by E-Mail at the address shown. Thank you for your compliance.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mary  
View profile  
 More options Dec 23 2008, 3:35 pm
Newsgroups: comp.soft-sys.sas
From: mlhow...@avalon.net (Mary)
Date: Tue, 23 Dec 2008 14:35:15 -0600
Local: Tues, Dec 23 2008 3:35 pm
Subject: Re: Output the Results of a Proc Freq To A SAS Dataset
You can save almost all output to a data step by using ODS.

1.  Find out the name of the ODS output by adding the statement
ods trace on;

just before your proc freq.

2.  Once you know the name of the portion of ODS that you want
to save, use the ODS OUTPUT statement to save it:

data onewayfreqs_set;
   stop;   /* initialize to empty */
run;
ods output onewayfreqs=3Donewayfreqs_set;
proc freq....

-Mary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Virtual SUG  
View profile  
 More options Dec 23 2008, 8:20 pm
Newsgroups: comp.soft-sys.sas
From: Virtual SUG <sfbay0...@aol.com>
Date: Tue, 23 Dec 2008 17:20:52 -0800 (PST)
Local: Tues, Dec 23 2008 8:20 pm
Subject: Re: Output the Results of a Proc Freq To A SAS Dataset
I don't mean to be overly critical of Mary's contribution to this
thread, but I am troubled by parts of what she wrote.

First, let's review the role of ODS with SAS Procedures.  PROCs
generate a series of Data Components, which are then passed to ODS, a
part of BASE SAS Software.  ODS binds each Data Component to a Table
Template and a Style Template and then "delivers" the resulting
"table" or "object" to "destinations."  The default destination is
LISTING, or your output window.  So, I think it is incorrect so say
that we want "the portion of ODS that you want to save;"  instead, we
want ODS to "deliver" our output to the OUTPUT destination, which
means we want to save some portion of the PROC-generated Data
Component as either a permanent or temporary SAS data set.

Second, specifying a valid permanent or temporary SAS data set name in
the ODS OUTPUT statement is "enough" to create the data set.  There is
_zero_ need to "initialize a SAS data set to empty" at ANY point or
process in the SAS system, ever.. This is, to me, confusing and
unnecessary, as well as bad coding practice.

Third, there are a lot of limitations to saving PROC FREQ-generated
output as SAS data sets.  If you use the OUT= option in the TABLES
statement to generate a SAS data set, and have specified two or more
variable names in the TABLES Statement, the the data set will only
contain frequency table info for the LAST variable you specified in
the statement.  That is a well-known and documented limitation of the
procedure.

You can use ODS to have it deliver the contents of the OneWayFreqs
object/table to either a permanent or temporary SAS data set.
However, if you specify the NOPRINT option in your PROC FREQ step to
suprress printing on the tables in your output window, then the PROC's
ability to transfer Data Components to ODS is disabled.  This is a
fundamental rule of using ODS with PROCS: using a NOPRINT option in
any PROC step prevents it from 'communicating' with the Output
Delivery System.

So, if you want the Data Component generated by PROC FREQ 'saved' as a
SAS data set, but don't want the output displayed in your Output
Window, you need to both OPEN the OUTPUT destination and close the
LISTING destination;

Form example;

ODS LISTING CLOSE;
ODS OUTPUT ONEWAYFREQS = MyFreqs;
PROC FREQ Data = My.Data;
TABLES var1 var2 var3
RUN;
ODS LISTING; * < re-open listing destination at end of PROC FREQ step;

You can then display your MyFreqs Data set using PROC PRINT or the
VIEWTABLE.  I am not exactly in love with the structure/contents of
this table, but what you see is what you get.

I hope this helps and that Santa is good to all !

Regards,

Andrew Karp
Sierra Information Services
www.sierrainformation.com
Sonoma, CA USA

On Dec 23, 12:35 pm, mlhow...@avalon.net (Mary) wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
"Fehd, Ronald J. (CDC/CCHIS/NCPHI)"  
View profile  
 More options Dec 24 2008, 10:21 am
Newsgroups: comp.soft-sys.sas
From: r...@CDC.GOV ("Fehd, Ronald J. (CDC/CCHIS/NCPHI)")
Date: Wed, 24 Dec 2008 10:21:43 -0500
Local: Wed, Dec 24 2008 10:21 am
Subject: Re: Output the Results of a Proc Freq To A SAS Dataset
http://www.sascommunity.org/wiki/Freq1Var


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »