<?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: date text file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858130#M37895</link>
    <description>&lt;P&gt;I would like to thank all of you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":bouquet:"&gt;💐&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I successfully ran the code that I would&amp;nbsp; share here&amp;nbsp; It was really helpful and I appreciate it.&lt;/P&gt;
&lt;P&gt;Thanks again!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename BSMB 'C:\Users\X\Desktop\BSMB\calv.txt';
data farm;
infile BSMB firstobs=2 dlm='09'x;
input ID Breed Parity DIM IM PI  I  INS  PC  CD  IF  Nins CIFI CCI;
informat PI  I  INS  PC  CD  IF ddmmyy.10;
format PI  I  INS  PC  CD  IF yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Feb 2023 20:03:19 GMT</pubDate>
    <dc:creator>always-good</dc:creator>
    <dc:date>2023-02-09T20:03:19Z</dc:date>
    <item>
      <title>date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858027#M37885</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I want to ask how to correctly convert a CSV file containig date formate to a text file. Because when I convert it, the variables are not arranged in the correct way.&lt;/P&gt;
&lt;P&gt;I will infile then this text file with date formate into SAS.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858027#M37885</guid>
      <dc:creator>always-good</dc:creator>
      <dc:date>2023-02-09T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858029#M37886</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Because when I convert it, the variables are not arranged in the correct way.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know what this means. Please show us a portion of the data, please show us your SAS code, and please show how your SAS code doesn't produce the desired results&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858029#M37886</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-09T14:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858036#M37887</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Because when I convert it, the variables are not arranged in the correct way.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know what this means. Please show us a portion of the data, please show us your SAS code, and please show how your SAS code doesn't produce the desired results&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I mean the CSV file is like in screenshot 1&amp;nbsp; and the text file obtained is in the second screenshot 2&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date excel file" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80270iCF8C3E4330B6937B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="date excel file" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date excel file&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date text file" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80271iCA4E51C089CD8C13/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="date text file" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date text file&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;and to infile the text file in SAS I used this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename BSMB 'C:\Users\x\Desktop\BSMB\text.txt';
data farm;
infile BSMB firstobs=2 dlm=';';
input Period THIP Month	THIIM ID	breed Parity DIM Milk  TOTALMilk 	FAT	 FM  	PROTEIN  PM  SC	SCS	DP GP Nins IM LastI CD	PC di met est	pro  CCI	ICIf	RT	HR 	RR 	PS
informat LastI CD	PC di met est	pro ddmmyy.;
  format LastI CD	PC di met est	pro yymmdd10.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 14:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858036#M37887</guid>
      <dc:creator>always-good</dc:creator>
      <dc:date>2023-02-09T14:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858041#M37888</link>
      <description>&lt;P&gt;I don't think your text file is delimited width semi-colon.&amp;nbsp; I think it is delimited with TAB DLM='09'x&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 15:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858041#M37888</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2023-02-09T15:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858066#M37889</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437029"&gt;@always-good&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I mean the CSV file is like in screenshot 1&amp;nbsp; and the text file obtained is in the second screenshot 2&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date excel file" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80270iCF8C3E4330B6937B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="date excel file" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date excel file&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="date text file" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80271iCA4E51C089CD8C13/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="date text file" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;date text file&lt;/span&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That is not a screen shot of a CSV. I would place a not-so-small wager that you have the file opened in a spreadsheet program. Which &lt;STRONG&gt;will make assumptions &lt;/STRONG&gt;and display values other than as they appear in a CSV file. Plus if you saved the file on closing then the content may well have changed.&lt;/P&gt;
&lt;P&gt;A CSV is TEXT and looks like this if comma separated:&lt;/P&gt;
&lt;PRE&gt;Project ID,FT Eload,Surg Med,Surg Med Proc,Metric,Date scaf,Domain
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/31/2020,In Basket
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/30/2020,In Basket
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/29/2020,In Basket
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/28/2020,In Basket
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/27/2020,In Basket
ConnectCare_014,H2,Surgery,Surgery,Time in In Basket per Day,10/26/2020,In Basket
ConnectCare_029,H1,Medical,Procedure,Time in In Basket per Day,6/1/2021,In Basket
ConnectCare_029,H1,Medical,Procedure,Time in In Basket per Day,5/31/2021,In Basket
ConnectCare_029,H1,Medical,Procedure,Time in In Basket per Day,5/30/2021,In Basket
ConnectCare_029,H1,Medical,Procedure,Time in In Basket per Day,7/31/2021,In Basket
&lt;/PRE&gt;
&lt;P&gt;If the separating character is other than a comma then replace the commas above with that character.&lt;/P&gt;
&lt;P&gt;Open your CSV file in a TEXT editor, such as Notepad or even the SAS editor. Copy some text then on the forum open a text box and paste that to show what your CSV looks like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also need to share the LOG from when you read that file. If there are actually values that should be read with a DDMMYY10. informat and you use DDMMYY., which will default to 6 characters, then the / make the first 6 characters and invalid date: 01/03/ (6 characters and no year to read)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 15:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858066#M37889</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-09T15:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858070#M37890</link>
      <description>&lt;P&gt;A csv file&amp;nbsp;&lt;U&gt;is&amp;nbsp;&lt;/U&gt;a text file, no need for conversion.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 15:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858070#M37890</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-02-09T15:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858114#M37892</link>
      <description>Yes.Thank you!</description>
      <pubDate>Thu, 09 Feb 2023 18:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858114#M37892</guid>
      <dc:creator>always-good</dc:creator>
      <dc:date>2023-02-09T18:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858117#M37893</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;After many trials, I obtained this text file like in screenshot 3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80287iF2C77B53B6DC291D/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I runned the following code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename BSMB 'C:\Users\x\Desktop\BSMB\calv.txt';
data farm;
infile BSMB firstobs=2 dlm='09'x;
input ID Breed Parity DIM IM PI date10. I date10. INS date10. PC date10. CD date10. IF date10. Nins CIFI CCI;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it is mentionned an invalid data in the log.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.PNG" style="width: 820px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80288i3A2C0F4CEBAB9F65/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.PNG" alt="4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How can SAS read the file please?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 18:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858117#M37893</guid>
      <dc:creator>always-good</dc:creator>
      <dc:date>2023-02-09T18:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858122#M37894</link>
      <description>&lt;P&gt;You need to use the DDMMYY10. informat. The DATE informat expects a date to be written like 01jan1960.&lt;/P&gt;
&lt;P&gt;And don't forget to use the colon modifier in front of the informats, otherwise list input won't work.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 19:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858122#M37894</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-02-09T19:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: date text file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858130#M37895</link>
      <description>&lt;P&gt;I would like to thank all of you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":bouquet:"&gt;💐&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I successfully ran the code that I would&amp;nbsp; share here&amp;nbsp; It was really helpful and I appreciate it.&lt;/P&gt;
&lt;P&gt;Thanks again!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename BSMB 'C:\Users\X\Desktop\BSMB\calv.txt';
data farm;
infile BSMB firstobs=2 dlm='09'x;
input ID Breed Parity DIM IM PI  I  INS  PC  CD  IF  Nins CIFI CCI;
informat PI  I  INS  PC  CD  IF ddmmyy.10;
format PI  I  INS  PC  CD  IF yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 20:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/date-text-file/m-p/858130#M37895</guid>
      <dc:creator>always-good</dc:creator>
      <dc:date>2023-02-09T20:03:19Z</dc:date>
    </item>
  </channel>
</rss>

