<?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: MMDDYY10. format turning all dates into 01/01/1960 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/852895#M337124</link>
    <description>this can happen if you already formatted your date once</description>
    <pubDate>Mon, 09 Jan 2023 18:25:44 GMT</pubDate>
    <dc:creator>gema</dc:creator>
    <dc:date>2023-01-09T18:25:44Z</dc:date>
    <item>
      <title>MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154005#M262707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know why the MMDDYY10. format turned all my date variables to the date constant 01/01/1960?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I applied the format in the first place because I had created a list of date variables, where many were showing up in PROC PRINT as a decimal; I was surprised to see the decimals because my understanding was SAS would read them as a whole number of days from the date 01/01/1960.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 01:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154005#M262707</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-24T01:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154006#M262708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually see that when I have a datetime variable, not a date variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using a dtdate9. format on the variable and see what shows up. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, provide more info, specifically what your original unformatted data looks like.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 04:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154006#M262708</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-24T04:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154007#M262709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Reeza!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even when I apply the dtdate9. format, though, all my dates turn into 01/01/1960.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I was doing is this:&amp;nbsp; For a number of datasets, I made date variables such that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var_a=1 then date01=01/1/2012; else date01= .;&lt;/P&gt;&lt;P&gt;if var_b=1 then date02=03/15/2013; else date02=.;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;The date variables, however, show up in unexpected formats.&amp;nbsp; Some are in decimals while others appear to be the number of days since 01/01/1960.&amp;nbsp; Not sure where the problem is. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 12:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154007#M262709</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-24T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154008#M262710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maisha&lt;/P&gt;&lt;P&gt;If you have correctly copied your code the problem lies with the way you have expressed the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sas interprets &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;date01=01/1/2012&lt;/SPAN&gt; to be 1 divided by 1 divided by 2012, a number close to zero.&amp;nbsp; Hence when formatted as a date it is shown as zero days from 1 Jan 1960, the 'zero' point for SAS dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use a SAS date literal, which is a DATE7., DATE9. or DATE11. expression enclosed in quotes and followed by a D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;if var_a=1 then date01='01JAN2012'D ; else date01= .;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;Richard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 12:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154008#M262710</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-03-24T12:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154009#M262711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;try this,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; num_var1=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: Consolas;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; date01=input(&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: purple; font-size: 10pt;"&gt;"01/1/2012"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; date01= &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: Consolas;"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; num_var2=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: Consolas;"&gt;2&lt;/STRONG&gt; &lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; date02=input(&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: purple; font-size: 10pt;"&gt;"03/15/2013"&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;); &lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: blue; font-size: 10pt;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt; date02=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: Consolas;"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-family: Consolas; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 12:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154009#M262711</guid>
      <dc:creator>pradeepalankar</dc:creator>
      <dc:date>2014-03-24T12:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154010#M262712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much - that's really helpful.&amp;nbsp; Since the code is for almost 800 date variables, though, do you know if there's any way to do this without going back through my entries for the dates and changing them so they're either 01/01/2012 or 01JAN2012?&lt;/P&gt;&lt;P&gt;When I enclose the dates as they're written now (many not in a SAS date literal format) in quotes and the 'd', that doesn't solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 12:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154010#M262712</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-24T12:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154011#M262713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct that the expression '01/01/2012'D will not be interpreted as a SAS date.&amp;nbsp; &lt;/P&gt;&lt;P&gt;You could adopt pradeepalankar's solution by copying and pasting the input("&amp;nbsp; and ",mmddyy10.) bits before and after all your dates.&amp;nbsp; Be aware that this is a less efficient solution for a large dataset because the input function needs to be evaluated for each condition each time, whereas the date literals are evaluated only once.&amp;nbsp; If you have more than a million rows you will notice the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 12:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154011#M262713</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-03-24T12:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154012#M262714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here is a way to change your code to date literals.&amp;nbsp; Simply paste all your if statements between Datalines4 and ;;;;&lt;/P&gt;&lt;P&gt;and run - then copy the new if condition from the log and paste them into your original code.&amp;nbsp; This only has to be done once.&lt;/P&gt;&lt;P&gt;Warning - untested code!&amp;nbsp; So make sure you have a backup copy of your original code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data _NULL_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Infile Datalines ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Input ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Length Date_Lit $ 12 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; p1 = find("=", _Infile_, 20) ; /* Second = */&lt;/P&gt;&lt;P&gt;&amp;nbsp; p2 = find(";", _Infile_) ; /* First ; */&lt;/P&gt;&lt;P&gt;&amp;nbsp; Part_A = Substr(_Infile_, 1, p1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Part_C = Substr(_Infile_, p2, 20) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date_MMDDYY = Substr(_Infile_, p1+1, p2-p1-1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date_Date9 = Put(Input(Date_MMDDYY, MMDDYY10.), Date9.) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Part_B = catt("'", Date_Date9, "'D") ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Result = catt(Part_A, Part_B, Part_C) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Put Result ;&lt;/P&gt;&lt;P&gt;Datalines4 ;&lt;/P&gt;&lt;P&gt;if var_a=1 then date01=01/1/2012; else date01= .;&lt;/P&gt;&lt;P&gt;if var_b=1 then date02=03/15/2013; else date02=.;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;;;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 13:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154012#M262714</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-03-24T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154013#M262715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some of what your code looks like, with the 800 variables. In general that sounds like a bad way to code something. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 15:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154013#M262715</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-24T15:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154014#M262716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure!&amp;nbsp; Some of&amp;nbsp; my code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code, I am match-merging a base dataset with about 30 datasets (each dataset contains info on different set of clients and their service/program usage; each dataset focuses on a different kind of service/program) in their own data step.&amp;nbsp; So, the list of variables to keep within each data step is different and the date variables each have only one value or missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It'd certainly be helpful if you let me know how efficient/not this system is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data=metricdata; BY last_name first_name; RUN;&lt;BR /&gt;PROC SORT data=_2013enrich_dup; BY last_name first_name; RUN;&lt;BR /&gt;DATA _2013enrich_dup_master;&lt;BR /&gt;MERGE metricdata (in=metric_) &lt;BR /&gt;_2013enrich_dup (in=_2013enrich_dup_ KEEP=last_name first_name&lt;BR /&gt;Participated_in_Enrichment_Prog1&lt;BR /&gt;Participated_in_Enrichment_Prog2&lt;BR /&gt;Participated_in_Enrichment_Prog3&lt;BR /&gt;Participated_in_Enrichment_Prog4&lt;BR /&gt;Participated_in_Enrichment_Prog5&lt;BR /&gt;Participated_in_Enrichment_Progr);&lt;BR /&gt;BY last_name first_name;&lt;/P&gt;&lt;P&gt;in_metric = metric_ ;&lt;BR /&gt;in__2013enrich_dup = _2013enrich_dup_ ;&lt;/P&gt;&lt;P&gt;if Participated_in_Enrichment_Prog1 =1 then date01=input("07/01/2013", mmddyy10.) ; else date01= . ;&lt;BR /&gt;if Participated_in_Enrichment_Prog2 =1 then date02=input("08/01/2013", mmddyy10.) ; else date02= . ;&lt;BR /&gt;if Participated_in_Enrichment_Prog3 =1 then date03=input("09/01/2013", mmddyy10.) ; else date03= . ;&lt;BR /&gt;if Participated_in_Enrichment_Prog4 =1 then date04=input("10/01/2013 ", mmddyy10.) ; else date04= . ;&lt;BR /&gt;if Participated_in_Enrichment_Prog5 =1 then date05=input("11/01/2013 ", mmddyy10.) ; else date05= . ;&lt;BR /&gt;if Participated_in_Enrichment_Progr =1 then date06=input("12/01/2013 ", mmddyy10.) ; else date06= . ; &lt;/P&gt;&lt;P&gt;if metric_=1 and _2013enrich_dup_=1 then output _2013enrich_dup_master;&lt;/P&gt;&lt;P&gt;drop Participated_in_Enrichment_Prog1&lt;BR /&gt;Participated_in_Enrichment_Prog2&lt;BR /&gt;Participated_in_Enrichment_Prog3&lt;BR /&gt;Participated_in_Enrichment_Prog4&lt;BR /&gt;Participated_in_Enrichment_Prog5&lt;BR /&gt;Participated_in_Enrichment_Progr;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data=metricdata; BY last_name first_name;RUN;&lt;BR /&gt;PROC SORT data=_2014enrich_dup;BY last_name first_name;RUN;&lt;BR /&gt;DATA _2014enrich_dup_master;&lt;BR /&gt;MERGE metricdata (in=metric_) &lt;BR /&gt;_2014enrich_dup (in=_2014enrich_dup_ KEEP=last_name first_name&lt;BR /&gt;Jan_Participated_in_Enrichment_P&lt;BR /&gt;Feb_Participated_in_Enrichment_P&lt;BR /&gt;Mar_Participated_in_Enrichment_P&lt;BR /&gt;);&lt;BR /&gt;BY last_name first_name;&lt;/P&gt;&lt;P&gt;in_metric = metric_ ;&lt;BR /&gt;in__2014enrich_dup = _2014enrich_dup_ ;&lt;BR /&gt;if Jan_Participated_in_Enrichment_P = 1 then date07= input("01/01/2014", mmddyy10.) ; else date07=.;&lt;BR /&gt;if Feb_Participated_in_Enrichment_P = 1 then date08= input("02/01/2014", mmddyy10.) ; else date08=.;&lt;BR /&gt;if Mar_Participated_in_Enrichment_P = 1 then date09= input("03/01/2014", mmddyy10.) ; else date09=.; &lt;/P&gt;&lt;P&gt;if metric_=1 and _2014enrich_dup_=1 then output _2014enrich_dup_master;&lt;BR /&gt;drop Jan_Participated_in_Enrichment_P&lt;BR /&gt;Feb_Participated_in_Enrichment_P&lt;BR /&gt;Mar_Participated_in_Enrichment_P;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 15:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/154014#M262716</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-24T15:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851330#M336476</link>
      <description>&lt;P&gt;My data is lie this can u help me to read it&lt;/P&gt;&lt;P&gt;data date;&lt;/P&gt;&lt;P&gt;input date ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;mar-01-2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;jan-03-2013&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&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>Wed, 28 Dec 2022 12:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851330#M336476</guid>
      <dc:creator>NAVEEN1710</dc:creator>
      <dc:date>2022-12-28T12:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851343#M336478</link>
      <description>Use&lt;BR /&gt;&lt;BR /&gt;input date anydtdte. ;</description>
      <pubDate>Wed, 28 Dec 2022 14:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851343#M336478</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-28T14:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851369#M336498</link>
      <description>&lt;P&gt;Since there is a simple pattern to this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if Participated_in_Enrichment_Prog1 =1 then date01=input("07/01/2013", mmddyy10.) ; else date01= . ;
if Participated_in_Enrichment_Prog2 =1 then date02=input("08/01/2013", mmddyy10.) ; else date02= . ;
if Participated_in_Enrichment_Prog3 =1 then date03=input("09/01/2013", mmddyy10.) ; else date03= . ;
if Participated_in_Enrichment_Prog4 =1 then date04=input("10/01/2013 ", mmddyy10.) ; else date04= . ;
if Participated_in_Enrichment_Prog5 =1 then date05=input("11/01/2013 ", mmddyy10.) ; else date05= . ;
if Participated_in_Enrichment_Progr =1 then date06=input("12/01/2013 ", mmddyy10.) ; else date06= . ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can replace it with code like this where you only need to type in ONE date constant.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array p Participated_in_Enrichment_Prog1-Participated_in_Enrichment_Prog5 Participated_in_Enrichment_ProgR;
array d date01-date06;
do index=1 to dim(P);
  if p[index]=1 then d[index]=intnx('month','01JUN2013'd,index,'b');
  else d[index]=.;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Dec 2022 15:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851369#M336498</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-28T15:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851464#M336546</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438000"&gt;@NAVEEN1710&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please don't post a new question to an existing one (that ideally should be closed and read-only).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please create your own new question.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1672281444635.png" style="width: 847px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/78920i291E7E674087DB1A/image-dimensions/847x381?v=v2" width="847" height="381" role="button" title="Patrick_0-1672281444635.png" alt="Patrick_0-1672281444635.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 02:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/851464#M336546</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-12-29T02:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: MMDDYY10. format turning all dates into 01/01/1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/852895#M337124</link>
      <description>this can happen if you already formatted your date once</description>
      <pubDate>Mon, 09 Jan 2023 18:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/MMDDYY10-format-turning-all-dates-into-01-01-1960/m-p/852895#M337124</guid>
      <dc:creator>gema</dc:creator>
      <dc:date>2023-01-09T18:25:44Z</dc:date>
    </item>
  </channel>
</rss>

