<?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 Creating dummy set w/ dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848577#M335491</link>
    <description>&lt;P&gt;Hi;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should know how to create a dummy SAS set after all these years but I have forgotten.&amp;nbsp; Code is below.&lt;/P&gt;
&lt;P&gt;Once this is resolved I will post my actual question in a separate post.&lt;/P&gt;
&lt;P&gt;In short 2/3 of the dates are&amp;nbsp; not&amp;nbsp; being posted as desired (Event_dt &amp;amp; Death_dt) . Thank you for your assistance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
     informat   ID  8.	 Discharge DDMMYY10. EVENT 8.  EVENT_DT DDMMYY10. DEATH 8. DEATH_DT DDMMYY10.;
	input   ID  	 Discharge DDMMYY10. EVENT  EVENT_DT DDMMYY10. DEATH  DEATH_DT DDMMYY10.;
	format Discharge DDMMYY10.  EVENT_DT DDMMYY10. Death_dt DDMMYY10. ;
datalines;
1 01/01/2020 1 01/15/2020 0 01/20/2020
2 01/01/2020 0 .          1 01/17/2020
3 01/01/2020 0 .          0  

 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 17:47:50 GMT</pubDate>
    <dc:creator>LB</dc:creator>
    <dc:date>2022-12-08T17:47:50Z</dc:date>
    <item>
      <title>Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848577#M335491</link>
      <description>&lt;P&gt;Hi;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should know how to create a dummy SAS set after all these years but I have forgotten.&amp;nbsp; Code is below.&lt;/P&gt;
&lt;P&gt;Once this is resolved I will post my actual question in a separate post.&lt;/P&gt;
&lt;P&gt;In short 2/3 of the dates are&amp;nbsp; not&amp;nbsp; being posted as desired (Event_dt &amp;amp; Death_dt) . Thank you for your assistance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
     informat   ID  8.	 Discharge DDMMYY10. EVENT 8.  EVENT_DT DDMMYY10. DEATH 8. DEATH_DT DDMMYY10.;
	input   ID  	 Discharge DDMMYY10. EVENT  EVENT_DT DDMMYY10. DEATH  DEATH_DT DDMMYY10.;
	format Discharge DDMMYY10.  EVENT_DT DDMMYY10. Death_dt DDMMYY10. ;
datalines;
1 01/01/2020 1 01/15/2020 0 01/20/2020
2 01/01/2020 0 .          1 01/17/2020
3 01/01/2020 0 .          0  

 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848577#M335491</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2022-12-08T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848580#M335492</link>
      <description>&lt;P&gt;More explanation, please.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I don't know what the desired outcome is, you didn't say. You only said that its not giving you the desired outcome.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Furthermore, I think the phrase "&lt;SPAN&gt;dummy SAS set" has no meaning to me, and so I request further explanation on that as well.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848580#M335492</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T17:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848583#M335493</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;-By dummy set&amp;nbsp; I mean -this is not a real dataset but rather used for examples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to outcomes- the event_dt and death_dt dates are&amp;nbsp; NOT&amp;nbsp; appearing in the&amp;nbsp; dataset&amp;nbsp; as I get an error&amp;nbsp; for "invalid" data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run the code&amp;nbsp; you see they do not appear.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 17:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848583#M335493</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2022-12-08T17:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848590#M335496</link>
      <description>&lt;P&gt;Here's what I see in the log, which you should see too&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NOTE: Invalid data for EVENT_DT in line 1010 16-25.
NOTE: Invalid data for DEATH_DT in line 1010 29-38.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1010        1 01/01/2020 1 01/15/2020 0 01/20/2020
ID=1 Discharge=01/01/2020 EVENT=1 EVENT_DT=. DEATH=0 DEATH_DT=. _ERROR_=1 _N_=1
NOTE: Invalid data for DEATH_DT in line 1011 29-38.
&lt;/PRE&gt;
&lt;P&gt;It is looking for EVENT_DT in columns 16-25. What data is in columns 16-25? 01/15/2020. It is also saying that 01/15/2020 is "invalid data". You are trying to read this in with informat DDMMYY10. Please look at this carefully and see if you can figure out what the error is here that causes 01/15/2020 to be "invalid data".&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848590#M335496</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-08T18:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848591#M335497</link>
      <description>&lt;P&gt;First, if you provide an INFORMAT statement then placing informat on the INPUT is not needed.&lt;/P&gt;
&lt;P&gt;Second, make sure that your informat actually matches your data.&lt;/P&gt;
&lt;P&gt;You have dates like 01/15/2020 and attempt to read with a DDMMYY10. informat (i.e. Day Month Year)15 cannot be a month. It appears that the informat you that you want to use is MMDDYY10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
     informat   ID  8.	 Discharge MMDDYY10. EVENT 8.  EVENT_DT MMDDYY10. DEATH 8. DEATH_DT MMDDYY10.;
	input   ID  	 Discharge  EVENT  EVENT_DT DEATH  DEATH_DT ;
	format Discharge DDMMYY10.  EVENT_DT DDMMYY10. Death_dt DDMMYY10. ;
datalines;
1 01/01/2020 1 01/15/2020 0 01/20/2020
2 01/01/2020 0 .          1 01/17/2020
3 01/01/2020 0 .          0 . 

 ;
run;&lt;/PRE&gt;
&lt;P&gt;You didn't have any problems with discharge date because 01/01 used 1 for a month (sort of regardless of DDMMYY or MMDDYY considerations).&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848591#M335497</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-08T18:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating dummy set w/ dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848597#M335499</link>
      <description>&lt;P&gt;Valid point on the dates-Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was was switching back and forth dates for something else and&amp;nbsp; missed that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the&amp;nbsp; tips of not needing the informat in both places.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 18:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-dummy-set-w-dates/m-p/848597#M335499</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2022-12-08T18:18:22Z</dc:date>
    </item>
  </channel>
</rss>

