<?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 Can't display dates in dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869390#M343392</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChingYee_0-1681296779228.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82639i2F474F1A22CDCEFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChingYee_0-1681296779228.png" alt="ChingYee_0-1681296779228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChingYee_1-1681296799499.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82640i291FA8099D8A5FCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChingYee_1-1681296799499.png" alt="ChingYee_1-1681296799499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2023 10:53:29 GMT</pubDate>
    <dc:creator>ChingYee</dc:creator>
    <dc:date>2023-04-12T10:53:29Z</dc:date>
    <item>
      <title>Can't display dates in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869390#M343392</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChingYee_0-1681296779228.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82639i2F474F1A22CDCEFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChingYee_0-1681296779228.png" alt="ChingYee_0-1681296779228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChingYee_1-1681296799499.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82640i291FA8099D8A5FCE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChingYee_1-1681296799499.png" alt="ChingYee_1-1681296799499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 10:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869390#M343392</guid>
      <dc:creator>ChingYee</dc:creator>
      <dc:date>2023-04-12T10:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't display dates in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869391#M343393</link>
      <description>&lt;P&gt;Use ":" (doc. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lestmtsref/n0lrz3gb7m9e4rn137op544ddg0v.htm#p1wk2kecsf6iz8n1ufug4i5pg6id" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lestmtsref/n0lrz3gb7m9e4rn137op544ddg0v.htm#p1wk2kecsf6iz8n1ufug4i5pg6id&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Q2;
input date : mmddyy10. name $ product $ Quantity Amount;
cards;
04262006 Peter Bike 20 1560
;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Plus some extras about the ":"&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi26/p073-26.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi26/p073-26.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 11:14:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869391#M343393</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-12T11:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can't display dates in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869398#M343398</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441747"&gt;@ChingYee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;has provided a correct answer, let me urge you to read the log when you have problems like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1     data Q2;
2     input date mmddyy10. name $ product $ Quantity Amount;
3     cards;

NOTE: Invalid data for date in line 4 1-10.
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
4           04262006 Peter Bike 20 1560
date=. name=eter product=Bike Quantity=20 Amount=1560 _ERROR_=1 _N_=1
NOTE: The data set WORK.Q2 has 1 observations and 5 variables.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you see how on this row the value of name is 'eter'? It isn't reading from the right place. It is reading from column 11 to get 'eter', and so columns 1-10 have already been read. That would make the value of date the contents of columns 1-10, or date is '04252006 P' which is not a valid date. This information can be very helpful in figuring out how to fix the problem. You are reading 10 characters for date, when in fact there are only 8 characters. Knowing this, another solution here is to change the informat to MMDDYY8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Q2;
input date mmddyy8. name $ product $ Quantity Amount;
cards;
04262006 Peter Bike 20 1560
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 12:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869398#M343398</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-12T12:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't display dates in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869522#M343441</link>
      <description>&lt;P&gt;When you use a format like this, the first part of your INPUT statement becomes&amp;nbsp;&lt;EM&gt;formatted input&lt;/EM&gt;, where the width of the format determines&amp;nbsp;&lt;EM&gt;exactly&lt;/EM&gt; how many characters are read.&lt;/P&gt;
&lt;P&gt;To make your whole INPUT&amp;nbsp;&lt;EM&gt;list input&lt;/EM&gt; (where the delimiters take precedence over the format widths), you need to use the colon modifier; it is also a good idea to match the format width with the actual length of the data, to avoid confusion when someone (most likely&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt;) reads the code in the future.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input date :mmddyy8. name $ product $ quantity amount;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Apr 2023 07:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-display-dates-in-dataset/m-p/869522#M343441</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-13T07:58:35Z</dc:date>
    </item>
  </channel>
</rss>

