<?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 Variables getting droped from external file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95375#M20076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #5f5f5f; font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I am reading an ebcdic flat file into sas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;It is creating the data set but it is dropping a number of variables off the end of each record. The external file has 303 columns/variables, my input statement has 303 columns/variables defined but the resulting dataset only contains 276 columns/variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;The data the is in the data set looks correct but I cannot understand why the variables are not getting picked up. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The input statement is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WORK.file;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFILE 'filename' recfm=f lrecl=858;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s370fpd5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ebcdic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length is correct and the last variable to be read stops at position 824.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appriciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2012 14:01:03 GMT</pubDate>
    <dc:creator>AndrewOS</dc:creator>
    <dc:date>2012-10-15T14:01:03Z</dc:date>
    <item>
      <title>Variables getting droped from external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95375#M20076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #5f5f5f; font-size: 10pt; font-family: Arial;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;I am reading an ebcdic flat file into sas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;It is creating the data set but it is dropping a number of variables off the end of each record. The external file has 303 columns/variables, my input statement has 303 columns/variables defined but the resulting dataset only contains 276 columns/variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;The data the is in the data set looks correct but I cannot understand why the variables are not getting picked up. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The input statement is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WORK.file;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFILE 'filename' recfm=f lrecl=858;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s370fpd5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ebcdic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length is correct and the last variable to be read stops at position 824.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appriciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95375#M20076</guid>
      <dc:creator>AndrewOS</dc:creator>
      <dc:date>2012-10-15T14:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variables getting droped from external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95376#M20077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you mean by "dropping" variables.&amp;nbsp; If you mean the values are all missing then make sure the lines are not truncated.&lt;/P&gt;&lt;P&gt;A simple way to look at the file is to use the LIST statement .&amp;nbsp; This will show you the HEX codes for lines that are not all normal printable ASCII characters.&amp;nbsp; I normally just list a few lines so that I can see the patterns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;INFILE 'filename' recfm=f lrecl=858;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; list;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_ &amp;gt; 10 then stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If instead you mean the variables do not end up in the output dataset then check that your INPUT statement is not reusing the same variable names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95376#M20077</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-10-15T14:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variables getting droped from external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95377#M20078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All valid points!&amp;nbsp; Also ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the variables you do have being assigned the proper value?&amp;nbsp; Check a few toward the end of the INPUT statement.&amp;nbsp; (Tom's suggestion about the LIST statement may help in that effort.)&amp;nbsp; While you may have taken liberties when posting your sample program, the sample you posted would define EBCDIC as another variable (one which you may not be mentioned in a subsequent KEEP statement).&amp;nbsp; Another liberty ... have you used other options such as MISSOVER or TRUNCOVER?&amp;nbsp; They can hide problems with the INPUT statement.&amp;nbsp; If you feel comfortable doing this, posting your log may help diagnose the problem.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95377#M20078</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-10-15T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Variables getting droped from external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95378#M20079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was copying the variables names from an layout file and there were indeed duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 15:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-getting-droped-from-external-file/m-p/95378#M20079</guid>
      <dc:creator>AndrewOS</dc:creator>
      <dc:date>2012-10-15T15:47:40Z</dc:date>
    </item>
  </channel>
</rss>

