<?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: Infile problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282979#M57595</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Then tried using enterprise guide but it's reading the &lt;U&gt;file as 1 long line of data&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is often a clue that the file originated in a different operating system than you are using and the end of line character(s) are different.&lt;/P&gt;
&lt;P&gt;My first guess is that you are using Windows and the file originated as some flavor of Unix. Often the solution is to ad the TERMSTR= option to your infile statement.&lt;/P&gt;
&lt;P&gt;If the file originated in UNIX then use TERMSTR=LF, if from MAC or Apple TERMSTR=CR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Windows default end of line is a CR(carriage return)LF(linefeed) when read by the other OS you often get slightly garbled data as there is an odd charcter in one position.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2016 15:00:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-07-08T15:00:42Z</dc:date>
    <item>
      <title>Infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282975#M57592</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a pipe delimited text file that's been giving me a headache for the last day or so. I cant seem to get it to import properly and can't determine why. I've tried with data step/infile&amp;nbsp;but had no luck. Then tried using enterprise guide but it's reading the file as 1 long line of data. I went back to infile but am stuck. Appreciate any help. Many thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example file data:&lt;/P&gt;
&lt;P&gt;"CUE.AFO.Ao"|"CUE.ACT.ID"|"CUE.ANT.Date"|"JLA-666" "24441626"|"htrwsen"|"01/19/16"|"10:07:40" "24451626"|"grrflos"|"02/23/16"|"16:36:30" "24471626"|"rvmzzen"|"01/19/16"|"16:41:09" "24481626"|"bbgalng"|"02/25/16"|"17:47:07" "24501626"|"jyghars"|"01/14/16"|"15:41:14" "24511626"|"jhtgars"|"02/04/16"|"10:48:16" "24531626"|"lkazall"|"01/15/16"|"11:05:22" "24551626"|"qwsdrig"|"04/25/16"|"13:37:32" "24561626"|"hhkleat"|"01/14/16"|"12:48:03"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 14:47:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282975#M57592</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-07-08T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282979#M57595</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Then tried using enterprise guide but it's reading the &lt;U&gt;file as 1 long line of data&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is often a clue that the file originated in a different operating system than you are using and the end of line character(s) are different.&lt;/P&gt;
&lt;P&gt;My first guess is that you are using Windows and the file originated as some flavor of Unix. Often the solution is to ad the TERMSTR= option to your infile statement.&lt;/P&gt;
&lt;P&gt;If the file originated in UNIX then use TERMSTR=LF, if from MAC or Apple TERMSTR=CR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Windows default end of line is a CR(carriage return)LF(linefeed) when read by the other OS you often get slightly garbled data as there is an odd charcter in one position.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 15:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282979#M57595</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-08T15:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282987#M57597</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe this file did originate from a different OS. I have other files I've been able to successfully import from this&amp;nbsp;environment. In fact my last post was related to this. To solve that particular problem I used&amp;nbsp;_infile_ = compress(_infile_,' ',"kw"); to remove the special characters that were causing me issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This file looks almost identical to those files except its not doing what I&amp;nbsp;want it to do, lol. I suspect it has to do with all of the quotes and the way the datalines trail each other. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: I tried the&amp;nbsp;&lt;SPAN&gt;TERMSTR=LF and that didn't help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 16:35:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/282987#M57597</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-07-08T16:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/283041#M57618</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this will display the hex codes for the end of record control characters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename badchr "d:/txt/badchr.txt" lrecl=80 recfm=f;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc fslist file=badchr;&lt;BR /&gt;;run;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works best in the old text editor with the command line turned on&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* on the FSLIST command line type hex on;nums on;&lt;/P&gt;&lt;P&gt;*You should see the end of file characters;&lt;/P&gt;&lt;P&gt;*Look for hex codes 0A 0D 0c at the end of the records;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 19:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/283041#M57618</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-07-08T19:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/283090#M57649</link>
      <description>&lt;P&gt;After spending all day toiling over this I finally figured out my problem. I feel kind of dumb now. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I listed a few records of data to the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_; 			
infile procfile; 		
input; 				
list; 					
if _n_ &amp;gt; 5 then 		
stop; 				
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Found the hex value that was giving me anxiety '0D'. Realized it was a carriage return and added&amp;nbsp;TERMSTR = CR to my infile which solved the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    173  |"02/10/16"|"15:16:12"."25921626"|"ceeedta"|"01/19/16"|"11:24:24"."25931626"|"shwedul"
    ZONE 72332332332723333333320233333333272667667627233233233272333333332023333333327276666762
    NUMR C202F10F162C215A16A122D2162625922C2312D9412C201F19F162C211A24A242D2162625932C2385E15C2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I guess you both, &lt;A id="link_17" class="lia-link-navigation" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/42345" target="_blank"&gt;rogerjdeangelis&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A id="link_18" class="lia-link-navigation" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_blank"&gt;ballardw&lt;/A&gt;,&amp;nbsp;were pointing me in the right direction. It just took forever for me to figure it out, lol. I was determined to conquer this before the weekend. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2016 00:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Infile-problem/m-p/283090#M57649</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-07-09T00:28:57Z</dc:date>
    </item>
  </channel>
</rss>

