<?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 pulling out specific dates from data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33182#M8039</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I have a data set that contains information such as&lt;BR /&gt;
&lt;BR /&gt;
ID         DATE                        PAY         EMP_GRADE    RANK&lt;BR /&gt;
0001    12/01/07                   24.32           O-2                GEN&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Each employee (ID) has observations that are daily for 2 years. The pay, grade and rank (using RETAIN) have been filled in over the entire 2 year period.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 I need to pull out a specific date (Dec 31st  for 2007, 2008, 2009) for each employee, so that I end with three records for each employee that include the variables ID, Pay, Grade and Rank.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ID         DATE                        PAY         EMP_GRADE    RANK&lt;BR /&gt;
0001    12/31/07                   24.32           E-2                LT&lt;BR /&gt;
0001    12/31/08                   24.32           O-2                LT&lt;BR /&gt;
0001    12/31/09                   24.32           O-2                GEN&lt;BR /&gt;
0012    12/31/07                   24.32           O-2                MJR&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I then have to give a frequence report for each year by the grade, counting either Enlisted (E) or Officer (O).  I think I need to use a PROC FREQ, but again, not sure how to get from point A to point B.  I'd really appreciate any help and insight!&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advace</description>
    <pubDate>Fri, 18 Mar 2011 16:34:16 GMT</pubDate>
    <dc:creator>lgtea57</dc:creator>
    <dc:date>2011-03-18T16:34:16Z</dc:date>
    <item>
      <title>pulling out specific dates from data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33182#M8039</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I have a data set that contains information such as&lt;BR /&gt;
&lt;BR /&gt;
ID         DATE                        PAY         EMP_GRADE    RANK&lt;BR /&gt;
0001    12/01/07                   24.32           O-2                GEN&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Each employee (ID) has observations that are daily for 2 years. The pay, grade and rank (using RETAIN) have been filled in over the entire 2 year period.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 I need to pull out a specific date (Dec 31st  for 2007, 2008, 2009) for each employee, so that I end with three records for each employee that include the variables ID, Pay, Grade and Rank.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ID         DATE                        PAY         EMP_GRADE    RANK&lt;BR /&gt;
0001    12/31/07                   24.32           E-2                LT&lt;BR /&gt;
0001    12/31/08                   24.32           O-2                LT&lt;BR /&gt;
0001    12/31/09                   24.32           O-2                GEN&lt;BR /&gt;
0012    12/31/07                   24.32           O-2                MJR&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I then have to give a frequence report for each year by the grade, counting either Enlisted (E) or Officer (O).  I think I need to use a PROC FREQ, but again, not sure how to get from point A to point B.  I'd really appreciate any help and insight!&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advace</description>
      <pubDate>Fri, 18 Mar 2011 16:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33182#M8039</guid>
      <dc:creator>lgtea57</dc:creator>
      <dc:date>2011-03-18T16:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: pulling out specific dates from data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33183#M8040</link>
      <description>Hi:&lt;BR /&gt;
  The DATE variable in SASHELP.PRICEDATA is a numeric variable and the days are all on the 1st of the month, but the concept in the program below still applies. The first report uses the MONTH and DAY functions to get out the observations falling on 12/1 of any year. The second report uses a third condition for an additional criteria of REGION=3 -- since the WHERE statement selects observations BEFORE the data gets to PROC FREQ, this may be one way for you to accomplish your reporting.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc freq data=sashelp.pricedata;&lt;BR /&gt;
title '1) Only Counting Based on Month and Day';&lt;BR /&gt;
where month(date) = 12 and day(date) = 1;&lt;BR /&gt;
  tables date*region /list;&lt;BR /&gt;
  format date mmddyy10.;&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc freq data=sashelp.pricedata;&lt;BR /&gt;
title '2) Only Counting Based on Region, Month and Day';&lt;BR /&gt;
where month(date) = 12 and day(date) = 1 and Region=3;&lt;BR /&gt;
  tables date*region &lt;BR /&gt;
         ProductLine*date/list;&lt;BR /&gt;
  format date mmddyy10.;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 18 Mar 2011 16:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33183#M8040</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-03-18T16:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: pulling out specific dates from data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33184#M8041</link>
      <description>Thank you for your help!  This was great!</description>
      <pubDate>Fri, 18 Mar 2011 19:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/pulling-out-specific-dates-from-data/m-p/33184#M8041</guid>
      <dc:creator>lgtea57</dc:creator>
      <dc:date>2011-03-18T19:52:40Z</dc:date>
    </item>
  </channel>
</rss>

