<?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: ChiSquare using dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ChiSquare-using-dates/m-p/863567#M341102</link>
    <description>&lt;P&gt;Fix the error in the code so that the PROC FORMAT step will run and then see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your existing code is trying to overwrite&amp;nbsp;intervention_dataset and create two other datasets named PROC and FORMAT.&amp;nbsp; But it should not run since your assignment statement is missing operators between the values after the equal sign.&amp;nbsp; And your expressions have unbalanced quotes. So your dataset was unchanged the format was not created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1886  data intervention_dataset proc format;
1887    value mydategroup
        -----
        180
1888      '06Mar2015'd - 16Mar2020'd='2015-2020'
                                  ----         ------
                                  49           49
1889      '17mar2020'd - '07Mar2023'd='2020-2023'
                    ------         ----
                    49             49
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE 49-169: The meaning of an identifier after a quoted string might change
             in a future SAS release.  Inserting white space between a
             quoted string and the succeeding identifier is recommended.

1890    ;
1891  run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Mar 2023 01:27:08 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-03-11T01:27:08Z</dc:date>
    <item>
      <title>ChiSquare using dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ChiSquare-using-dates/m-p/863560#M341101</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;Hi everyone,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;I am new to SAS and just learning the programming language.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;I have one datafile called intervention_dataset, that has assessments completed from 2015-2023 (n=1925), and I am looking to match a pair of assessment outcomes (from different children) between 2015-2020 (n=1225), and 2020-2023 (n= 700) on key variables. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;U&gt;Code:&lt;/U&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;Data intervention_dataset
Proc format;
value mydategroup
'06Mar2015'd - 16Mar2020'd='2015-2020'
'17mar2020'd - '07Mar2023'd='2020-2023'
;
run;&lt;BR /&gt;&lt;BR /&gt;Proc freq data=intervention_dataset;&lt;BR /&gt;tables (Var1 Var2 Var3) *complete_d / chisq;&lt;BR /&gt;format complete_d mydategroup.;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;SPAN class=""&gt;When I use this code, I receive a contingency table with the MM/DD/YYYY, as opposed to a composite of all outcomes within the restricted dates (see screenshot). No warning error in the LOG.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;I cannot share my data due to ethical restrictions, but d&lt;/SPAN&gt;&lt;SPAN class=""&gt;o you have any suggestions?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 11 Mar 2023 00:12:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ChiSquare-using-dates/m-p/863560#M341101</guid>
      <dc:creator>jiantos</dc:creator>
      <dc:date>2023-03-11T00:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: ChiSquare using dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ChiSquare-using-dates/m-p/863567#M341102</link>
      <description>&lt;P&gt;Fix the error in the code so that the PROC FORMAT step will run and then see if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your existing code is trying to overwrite&amp;nbsp;intervention_dataset and create two other datasets named PROC and FORMAT.&amp;nbsp; But it should not run since your assignment statement is missing operators between the values after the equal sign.&amp;nbsp; And your expressions have unbalanced quotes. So your dataset was unchanged the format was not created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1886  data intervention_dataset proc format;
1887    value mydategroup
        -----
        180
1888      '06Mar2015'd - 16Mar2020'd='2015-2020'
                                  ----         ------
                                  49           49
1889      '17mar2020'd - '07Mar2023'd='2020-2023'
                    ------         ----
                    49             49
ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE 49-169: The meaning of an identifier after a quoted string might change
             in a future SAS release.  Inserting white space between a
             quoted string and the succeeding identifier is recommended.

1890    ;
1891  run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 01:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ChiSquare-using-dates/m-p/863567#M341102</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-11T01:27:08Z</dc:date>
    </item>
  </channel>
</rss>

