<?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 Re: Count the instances between two dates with a criteria met in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423428#M104127</link>
    <description>&lt;P&gt;just create a var using the month function ie month=month(), and then use proc freq as someone else indicated, except use the 'list' options on the table statement ie tables month*tp*elevate /list;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Dec 2017 06:23:31 GMT</pubDate>
    <dc:creator>pau13rown</dc:creator>
    <dc:date>2017-12-23T06:23:31Z</dc:date>
    <item>
      <title>Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423361#M104094</link>
      <description>&lt;P&gt;Hi, relatively new SAS user here. Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a table with the number of occurrences&amp;nbsp;in each month by 2 criteria&amp;nbsp;(TP and Elevated). So for the following example, I need a table with the # of TP=1 and Elevated=1 occurring in January.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example data&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; DOV&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Elevated&amp;nbsp; TP&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;01JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;05JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;07JAN2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;01MAR2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;09MAR2017&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to calculate number of occurrences in&amp;nbsp;each month by TP using:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CREATE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;TABLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; screen_mth_detail &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;SELECT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(TP), COUNT(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ID)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TP_Count, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUM (DOC between &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'01AUG2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AND&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'31AUG2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AUG17_Count,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUM (DOC between &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'01SEP2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AND&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'30SEP2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SEP17_Count,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUM (DOC between &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'01OCT2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AND&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'31OCT2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; OCT17_Count,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUM (DOC between &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'01NOV2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AND&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'30NOV2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; NOV17_Count,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;SUM (DOC between &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'01DEC2017'd&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AND&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;'31DEC2017'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DEC17_Count&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; epds1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TP;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;How can I calculate the same but for only the cases in which Elevated=1?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 18:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423361#M104094</guid>
      <dc:creator>zion1</dc:creator>
      <dc:date>2017-12-22T18:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423367#M104096</link>
      <description>I need a sample HAVE and sample WANT( your required output) for me to understand as I am dumb unlike others. Requesting you for the same with a brief definition of logic. Thank you</description>
      <pubDate>Fri, 22 Dec 2017 19:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423367#M104096</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-22T19:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423370#M104097</link>
      <description>&lt;P&gt;Please supply more example data that illustrates why you need DISTINCT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing shown indicates the need for DISTINCT and if you don't need it, it's much easier to switch to a SAS PROC such as PROC MEANS which will aggregate data by month automatically without you having to hardcode the time intervals.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 19:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423370#M104097</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-22T19:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423377#M104099</link>
      <description>&lt;P&gt;Looks like I may be making this more complicated than it needs to be.&amp;nbsp; My data looks like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;DOV&lt;/TD&gt;&lt;TD&gt;Aged&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;TD&gt;Elevate&lt;/TD&gt;&lt;TD&gt;TP&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;8-Aug-17&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;9-Aug-17&lt;/TD&gt;&lt;TD&gt;1195&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;9-Aug-17&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;9-Aug-17&lt;/TD&gt;&lt;TD&gt;42&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;15-Aug-17&lt;/TD&gt;&lt;TD&gt;275&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;15-Aug-17&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;16-Sep-17&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;17-Sep-17&lt;/TD&gt;&lt;TD&gt;68&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;17-Sep-17&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need an output like this: (count of visits that are at TP1-3 in each month and of those, how many were elevated (elevate=1)&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 1 Elevated&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 2 Elevate&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;TP 3 Elevated&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;August&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;3&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Sept&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 20:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423377#M104099</guid>
      <dc:creator>zion1</dc:creator>
      <dc:date>2017-12-22T20:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423384#M104100</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID DOV :anydtdte. Aged Score Elevate TP ;
datalines;
13 8-Aug-17 32 3 0 1 
11 9-Aug-17 1195 14 1 3 
19 9-Aug-17 43 0 0 2 
14 9-Aug-17 42 14 1 2 
10 15-Aug-17 275 14 1 3 
14 15-Aug-17 19 12 1 3 
17 16-Sep-17 35 0 0 2 
18 17-Sep-17 68 14 1 2 
15 17-Sep-17 32 3 0 1 
;

proc freq data=have;
format DOV monname10.;
table DOV*tp*elevate / out=freqs sparse noprint;
run;

data fixed;
set freqs;
id = catx(" ", "TP", tp, ifc(elevate, "Elevated", ""));
run;
 
proc transpose data=fixed out=want(drop=_: );
by DOV;
id id;
idlabel id;
var count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Dec 2017 21:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423384#M104100</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-22T21:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423428#M104127</link>
      <description>&lt;P&gt;just create a var using the month function ie month=month(), and then use proc freq as someone else indicated, except use the 'list' options on the table statement ie tables month*tp*elevate /list;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 06:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423428#M104127</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2017-12-23T06:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423458#M104145</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183379"&gt;@pau13rown&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;just create a var using the month function ie month=month(), and then use proc freq as someone else indicated, except use the 'list' options on the table statement ie&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tables date*tp*elevate /list;
format date monname3.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's not required, in SAS you can apply the month format within PROC FREQ so you don't need a new variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 19:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423458#M104145</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-23T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423471#M104152</link>
      <description>&lt;P&gt;'not required' depends on your temperament.Having a variable that is merely implied doesn't encourage defensive coding etc&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 00:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423471#M104152</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2017-12-24T00:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423474#M104153</link>
      <description>&lt;P&gt;What's 'defensive coding'?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 02:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423474#M104153</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-24T02:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423475#M104154</link>
      <description>&lt;P&gt;it's a euphemism for paranoia in the drug industry. For example, if i "know" my text variable (lab parameter for example) is in caps, i am still writing my code as "if upcase(param)='HCT' then ...". rather than simply "if param='HCT' then ..." If you make an error in industry there is nothing you can say to get you out of it, the cost is too high, hence defensive coding&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 02:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423475#M104154</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2017-12-24T02:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423477#M104155</link>
      <description>&lt;P&gt;I agree with the&amp;nbsp;virtues of&amp;nbsp;defensive coding. I consider the temporary association of a format Inside an analysis procedure such as proc freq to be defensive against any format association that might have been made outside the procedure. It also défends against the multiplication of versions of your data.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 04:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423477#M104155</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-24T04:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count the instances between two dates with a criteria met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423478#M104156</link>
      <description>&lt;P&gt;well, we could waste time discussing it, the industry is a different universe and we'll speak past each other. There would be no multiplication of data, obviously. The analysis plan would stipulate or imply that the variable is needed, thus it would exist in a permanent dataset, refer to cdisc, sdtm, adam. The format applied would be indicated within that documentation etc.&amp;nbsp;When i said 'etc' above i was alluding to validation, you cannot validate a variable that doesn't exist. The process is extremely pedantic, maybe they document things with proc compare etc. Thus, throwing a format within freq shows an old school nonchalance that doesn't exist anymore. Each to his own, but i would try to encourage (only incidentally) good programming practice when discussing code: &lt;A href="http://www.phusewiki.org/wiki/index.php?title=Good_Programming_Practice" target="_blank"&gt;http://www.phusewiki.org/wiki/index.php?title=Good_Programming_Practice&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 04:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-the-instances-between-two-dates-with-a-criteria-met/m-p/423478#M104156</guid>
      <dc:creator>pau13rown</dc:creator>
      <dc:date>2017-12-24T04:57:50Z</dc:date>
    </item>
  </channel>
</rss>

