Data intervention_dataset Proc format; value mydategroup '06Mar2015'd - 16Mar2020'd='2015-2020' '17mar2020'd - '07Mar2023'd='2020-2023' ; run;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.
Proc freq data=intervention_dataset;
tables (Var1 Var2 Var3) *complete_d / chisq;
format complete_d mydategroup.;
run;
Fix the error in the code so that the PROC FORMAT step will run and then see if it works.
Your existing code is trying to overwrite intervention_dataset and create two other datasets named PROC and FORMAT. But it should not run since your assignment statement is missing operators between the values after the equal sign. And your expressions have unbalanced quotes. So your dataset was unchanged the format was not created.
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.