<?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 with blanks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363450#M274894</link>
    <description>&lt;P&gt;You might want to post a few records from your file by attaching a TXT file if the data isn't sensitive. Your data step is syntactically incorrect as posted as you do not include an INPUT statement to start reading unless that just got missed in pasting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approaches to reading this will vary depending on the actual text file structure. It may be that you want to use column input to read at specific columns for your variables for instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2017 14:27:02 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-06-01T14:27:02Z</dc:date>
    <item>
      <title>infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363420#M274892</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to infile rpt. file and i have problems with values that have blanks.&amp;nbsp; Sas is giving me records from next&amp;nbsp;column but I want him to show me the&amp;nbsp;blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the file looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5------10----&lt;/P&gt;&lt;P&gt;ab&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;null&lt;/P&gt;&lt;P&gt;null&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no i want to infile it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;informat&amp;nbsp; ab &amp;nbsp;$CHAR2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;infile 'path/rpt.' missover;&lt;/P&gt;&lt;P&gt;@5 ab: $CHAR2.&lt;/P&gt;&lt;P&gt;cd:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;and the result is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ab&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cd&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;null&amp;nbsp; null&lt;/P&gt;&lt;P&gt;null&amp;nbsp; null&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 13:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363420#M274892</guid>
      <dc:creator>Jedrzej</dc:creator>
      <dc:date>2017-06-01T13:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363429#M274893</link>
      <description>&lt;P&gt;When posting text where positioning is crucial, use the {i} button. The standard posting window eliminates leading blanks and the like, so your examples can't be used for testing.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 13:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363429#M274893</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-01T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363450#M274894</link>
      <description>&lt;P&gt;You might want to post a few records from your file by attaching a TXT file if the data isn't sensitive. Your data step is syntactically incorrect as posted as you do not include an INPUT statement to start reading unless that just got missed in pasting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approaches to reading this will vary depending on the actual text file structure. It may be that you want to use column input to read at specific columns for your variables for instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 14:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363450#M274894</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-01T14:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363460#M274895</link>
      <description>i cant add my file,sorry. this is just an example, you can write your own. the problem is that when i have blanks in record one, sas writes values from the next record and i dont know why&lt;BR /&gt;&lt;BR /&gt;ive tried missover, pointers, and it is the same. Maybe because im infiling from rpt file not txt but im not sure</description>
      <pubDate>Thu, 01 Jun 2017 14:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363460#M274895</guid>
      <dc:creator>Jedrzej</dc:creator>
      <dc:date>2017-06-01T14:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363479#M274896</link>
      <description>&lt;P&gt;If you raw data file is arranged in fixed column locations then tell SAS that is what you want. &amp;nbsp;So let's assume this is what your data file looks like:&lt;/P&gt;
&lt;PRE&gt;----5----10----
    ab   cd
         1
    null null
    null null
         4&lt;/PRE&gt;
&lt;P&gt;Do not use the MISSOVER option instead use the TRUNCOVER option because it handles short lines better.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile xx truncover ;
  input var1 $5-9 var2 $10-15 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 15:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363479#M274896</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-01T15:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363705#M274897</link>
      <description>&lt;P&gt;ok I know what is the problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sas treats blank space as a delimiter so it goes to the next record and reads it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use dsd option but then i have to use pointer for every column. Is there any other solution ? cause i have like 300columns.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 07:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363705#M274897</guid>
      <dc:creator>Jedrzej</dc:creator>
      <dc:date>2017-06-02T07:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: infile- problem with blanks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363707#M274898</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Jedrzej wrote: &lt;BR /&gt;
&lt;P&gt;I can use dsd option but then i have to use pointer for every column. Is there any other solution ? cause i have like 300columns.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reading a file in fixed width format you have to tell sas where each variable begins and how many chars belong to it.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2017 08:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-problem-with-blanks/m-p/363707#M274898</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-06-02T08:07:48Z</dc:date>
    </item>
  </channel>
</rss>

