<?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: Date11. Format Issue while reading the raw data in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818357#M323028</link>
    <description>Got your point Tom, No need to make Customer_id and TRANS_ID as numeric here.&lt;BR /&gt;Also thanks a lot for this detailed solution.</description>
    <pubDate>Wed, 15 Jun 2022 15:45:36 GMT</pubDate>
    <dc:creator>satyamsachan26</dc:creator>
    <dc:date>2022-06-15T15:45:36Z</dc:date>
    <item>
      <title>Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818299#M323004</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to read the below data but I think because of date11. format, data is not correctly read by SAS. Please help how to read this data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data transaction;&lt;BR /&gt;infile cards dlm='09'x;&lt;BR /&gt;input Customer_Id Trans_Id Trans_Date date11. Trans_Amt 5.0;&lt;BR /&gt;format Trans_Date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;101 111 21-Apr-21 20000&lt;BR /&gt;102 167 22-Apr-22 15000&lt;BR /&gt;104 345 23-Apr-22 14000&lt;BR /&gt;105 112 24-Apr-22 12000&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is tab-delimited to I used dlm='09'x.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;O/P-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="satyamsachan26_1-1655299268928.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72302i30375123B0F08AB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="satyamsachan26_1-1655299268928.png" alt="satyamsachan26_1-1655299268928.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Trans_Amt is not correct.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818299#M323004</guid>
      <dc:creator>satyamsachan26</dc:creator>
      <dc:date>2022-06-15T13:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818301#M323006</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input Customer_Id Trans_Id Trans_Date :date11. Trans_Amt 5.0;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the colon (not semi-colon) before date11.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The colon indicates that SAS should start reading from the next non-blank column until it reaches another non-blank column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date11. is an INFORMAT, it is used when reading data IN. In this case, DATE11. is not a FORMAT.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818301#M323006</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-15T13:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818344#M323020</link>
      <description>&lt;P&gt;While&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;has given you the right solution, it might be important to you to understand why your original program is not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATE11. informat tells SAS to read 11 characters.&amp;nbsp; That includes the first digit of the Trans_Amt (not a good idea).&amp;nbsp; While SAS figures out to ignore that digit when assigning a value to your date variable, it still is in the wrong position to accurately read Trans_Amt.&amp;nbsp; You can see that your Trans_Amt values begin with the second digit, not the first digit, of the proper amount.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 15:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818344#M323020</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-06-15T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818350#M323023</link>
      <description>&lt;P&gt;Do not read a delimited file using formatted input statement.&amp;nbsp; The fixed length of the informat specification in the INPUT statement will ignore the delimiters.&amp;nbsp; So if the width of the field in the line is different than the width in the informat specification the pointer will be in the wrong place to read the next field on the line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add an informat to the INPUT statement and still use list mode by using the colon modifier.&amp;nbsp; Also when you use list mode to read the value SAS will IGNORE the width on the informat, instead it will adjust to the width of the field being read. Your last variable does not need any special informat since it is just a number.&amp;nbsp; SAS already knows how to read numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input Customer_Id Trans_Id Trans_Date :date. Trans_Amt ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also do you really want to make CUSTOMER_ID and TRANS_ID as NUMERIC variables?&amp;nbsp; What would be the meaning of the mean or standard deviation of a CUSTOMER_ID?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 15:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818350#M323023</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-15T15:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818353#M323026</link>
      <description>Thanks a lot for this quick solution Paige Miller.</description>
      <pubDate>Wed, 15 Jun 2022 15:38:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818353#M323026</guid>
      <dc:creator>satyamsachan26</dc:creator>
      <dc:date>2022-06-15T15:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818354#M323027</link>
      <description>Hi, Thanks a lot for this detailed explanation.</description>
      <pubDate>Wed, 15 Jun 2022 15:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818354#M323027</guid>
      <dc:creator>satyamsachan26</dc:creator>
      <dc:date>2022-06-15T15:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date11. Format Issue while reading the raw data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818357#M323028</link>
      <description>Got your point Tom, No need to make Customer_id and TRANS_ID as numeric here.&lt;BR /&gt;Also thanks a lot for this detailed solution.</description>
      <pubDate>Wed, 15 Jun 2022 15:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date11-Format-Issue-while-reading-the-raw-data-in-SAS/m-p/818357#M323028</guid>
      <dc:creator>satyamsachan26</dc:creator>
      <dc:date>2022-06-15T15:45:36Z</dc:date>
    </item>
  </channel>
</rss>

