<?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: Trying to import my data but get a problem with the date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690954#M210240</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345749"&gt;@KOUAME&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI, Trying to import my data but get a problem with the date format ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What problem? Please describe in detail, and if possible, show us.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 12:59:29 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-10-12T12:59:29Z</dc:date>
    <item>
      <title>Trying to import my data but get a problem with the date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690951#M210237</link>
      <description>&lt;P&gt;HI, Trying to import my data but get a problem with the date format, can anyone helps me:&lt;/P&gt;&lt;P&gt;You will find the data attached and my code:&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;&lt;P&gt;data client;&lt;/P&gt;&lt;P&gt;infile"C:\Users\KOUAME\Downloads\clients.txt" missover firstobs = 2;&lt;BR /&gt;input PRENOM$ 1-11 NOM:$ 14-27 DAT_NAI 27-37 VILLE$ 39-47 DEPT 48-49 ACHATS 53-54 @58 ANCIENNETE ;&lt;/P&gt;&lt;P&gt;format DAT_NAI ddmmyy10.;&lt;BR /&gt;informat DAT_NAI ddmmyy10.;&lt;BR /&gt;&lt;BR /&gt;format ANCIENNETE comma3.1;&lt;BR /&gt;informat ANCIENNETE comma3.1;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 12:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690951#M210237</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-10-12T12:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to import my data but get a problem with the date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690954#M210240</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345749"&gt;@KOUAME&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI, Trying to import my data but get a problem with the date format ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What problem? Please describe in detail, and if possible, show us.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 12:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690954#M210240</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-12T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to import my data but get a problem with the date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690964#M210247</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rykouame_0-1602508557540.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50561i2F8120A7FC454049/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rykouame_0-1602508557540.png" alt="Rykouame_0-1602508557540.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;when I execute it gives this table with missing values in DAT_NAI.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 13:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690964#M210247</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-10-12T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to import my data but get a problem with the date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690967#M210248</link>
      <description>&lt;P&gt;If you use a column range in the INPUT statement then you cannot use a specific informat.&amp;nbsp; SAS will just use normal $w. informat for character variables and w. informat for numeric variables.&amp;nbsp; So instead of using a column range just use&amp;nbsp;@ nn to position the pointer before the value and then you can use an informat.&amp;nbsp; Also since your data is fixed column you should include the informat in the INPUT statement to prevent it from running over missing values and finding the next character to read.&amp;nbsp; Adding the INFORMAT statement is optional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also do NOT include a number of decimal places in an INFORMAT unless your source strings have explicitly been generated with the decimal point indicator character removed.&amp;nbsp; Otherwise integer values will be divided by that power of 10 to insert the implicit decimal point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also do NOT use the older MISSOVER option, instead use the newer TRUNCOVER option. Your example is exactly the case where it can make a big difference.&amp;nbsp; Consider the case where your informat uses width of 3 bytes starting in column 60 and the text file only has 2 characters there.&amp;nbsp; With MISSOVER the variable will be missing. With TRUNCOVER the informat will read the 2 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data client;
  *infile"C:\Users\KOUAME\Downloads\clients.txt" missover firstobs = 2;
  infile cards truncover firstobs=2;
  input PRENOM $ 1-11 NOM $ 14-27 @29 DAT_NAI ddmmyy10.
        VILLE $ 39-47 DEPT 48-49 ACHATS 53-54 
        @60 ANCIENNETE comma3.
  ;
  format DAT_NAI ddmmyy10.;
  informat DAT_NAI ddmmyy10.;
  format ANCIENNETE comma3.1;
  informat ANCIENNETE comma3.;
cards;
PRENOM       NOM            DAT_NAI    VILLE   DEPT ACHATS ANCIENNETE
Anne Sophie  Martineau      14/08/1955 PARIS   75   8      0,3
Marie-Anne   Dupont         01/12/1977 ORLEANS
Roger        Martin du Gard 18/01/1988         29   17     1,8
;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 13:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690967#M210248</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-12T13:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to import my data but get a problem with the date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690972#M210252</link>
      <description>&lt;P&gt;Thks&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 13:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-import-my-data-but-get-a-problem-with-the-date-format/m-p/690972#M210252</guid>
      <dc:creator>KOUAME</dc:creator>
      <dc:date>2020-10-12T13:42:16Z</dc:date>
    </item>
  </channel>
</rss>

