<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic two-way frequency analysis in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40626#M5563</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I need to get a table for gender by year for a specific range of years (2002-2007). I'm new to this program and as much as I understand I should first create a sub-set of years at question and then format my variables for the proc freq statement.&lt;BR /&gt;
&lt;BR /&gt;
What I am getting so far - 0 ovservations from the data set.&lt;BR /&gt;
&lt;BR /&gt;
data m.gender1;&lt;BR /&gt;
set m.gender;&lt;BR /&gt;
if gender=1 then gender1='F';&lt;BR /&gt;
if gender=2 then gender1='M';&lt;BR /&gt;
run; *it works*;&lt;BR /&gt;
&lt;BR /&gt;
data m.gender_year;&lt;BR /&gt;
set Tmp1.gender1;&lt;BR /&gt;
year=datepart(created_date);&lt;BR /&gt;
format year date9.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data m.year;&lt;BR /&gt;
set m.gender_year;&lt;BR /&gt;
where year=2002;&lt;BR /&gt;
run; *0 observations*&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=m.gender_year;&lt;BR /&gt;
Tables Year Gender1&lt;BR /&gt;
	Year*Gender1;&lt;BR /&gt;
	where year&amp;gt;=2002;&lt;BR /&gt;
		run; *doesn't work as well*</description>
    <pubDate>Wed, 20 Aug 2008 15:43:44 GMT</pubDate>
    <dc:creator>mp_C</dc:creator>
    <dc:date>2008-08-20T15:43:44Z</dc:date>
    <item>
      <title>two-way frequency analysis</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40626#M5563</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I need to get a table for gender by year for a specific range of years (2002-2007). I'm new to this program and as much as I understand I should first create a sub-set of years at question and then format my variables for the proc freq statement.&lt;BR /&gt;
&lt;BR /&gt;
What I am getting so far - 0 ovservations from the data set.&lt;BR /&gt;
&lt;BR /&gt;
data m.gender1;&lt;BR /&gt;
set m.gender;&lt;BR /&gt;
if gender=1 then gender1='F';&lt;BR /&gt;
if gender=2 then gender1='M';&lt;BR /&gt;
run; *it works*;&lt;BR /&gt;
&lt;BR /&gt;
data m.gender_year;&lt;BR /&gt;
set Tmp1.gender1;&lt;BR /&gt;
year=datepart(created_date);&lt;BR /&gt;
format year date9.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data m.year;&lt;BR /&gt;
set m.gender_year;&lt;BR /&gt;
where year=2002;&lt;BR /&gt;
run; *0 observations*&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=m.gender_year;&lt;BR /&gt;
Tables Year Gender1&lt;BR /&gt;
	Year*Gender1;&lt;BR /&gt;
	where year&amp;gt;=2002;&lt;BR /&gt;
		run; *doesn't work as well*</description>
      <pubDate>Wed, 20 Aug 2008 15:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40626#M5563</guid>
      <dc:creator>mp_C</dc:creator>
      <dc:date>2008-08-20T15:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: two-way frequency analysis</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40627#M5564</link>
      <description>You have a libref of "Tmp1", first introduced in the second DATA step.  Maybe that should be "m.gender1"??  Not sure.&lt;BR /&gt;
&lt;BR /&gt;
My recommendation is to remove the WHERE filter and analyze your data in its entirety, using FREQ, first with no TABLES statement&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 20 Aug 2008 18:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40627#M5564</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-20T18:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: two-way frequency analysis</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40628#M5565</link>
      <description>Thanks, I found the solution with some help from my friends :))&lt;BR /&gt;
I did it this way:&lt;BR /&gt;
&lt;BR /&gt;
data m.gender;&lt;BR /&gt;
set cesgrdb2.Eben_out_vw (keep= created_date gender);&lt;BR /&gt;
gender1=put(gender,1.); /*we specify the format and length of a new variable*/&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data m.gender1;&lt;BR /&gt;
set m.gender;&lt;BR /&gt;
if gender=1 then gender1='F';&lt;BR /&gt;
if gender=2 then gender1='M';&lt;BR /&gt;
run; *it works*;&lt;BR /&gt;
data m.gender_year;&lt;BR /&gt;
set Tmp1.gender1;&lt;BR /&gt;
year=datepart(created_date);&lt;BR /&gt;
format year date9.;&lt;BR /&gt;
run;&lt;BR /&gt;
data m.gender_year1;&lt;BR /&gt;
set m.gender_year;&lt;BR /&gt;
date=year(year);&lt;BR /&gt;
run; */to get year in the table*/;&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=m.gender_year1;&lt;BR /&gt;
Tables Date Gender1 /*it would be better to get a table the other way - Gender1*Date*/&lt;BR /&gt;
	Date*Gender1;&lt;BR /&gt;
	where date&amp;gt;=2002 and date&amp;lt;=2007;&lt;BR /&gt;
		run;*it works*;</description>
      <pubDate>Wed, 20 Aug 2008 18:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/two-way-frequency-analysis/m-p/40628#M5565</guid>
      <dc:creator>mp_C</dc:creator>
      <dc:date>2008-08-20T18:44:11Z</dc:date>
    </item>
  </channel>
</rss>

