<?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 Importing cuts-off field length in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623139#M183386</link>
    <description>&lt;P&gt;Hi, when I proc import a raw .txt file, a specific field (name of customer) cuts off at a certain length, other fields remain in their lengths, some longer.. No idea why.&amp;nbsp; Please help !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my proc import code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt; out = raw datafile = "S:\Banking\MIS\Reports\Report_&amp;amp;rpt_dt..txt"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;dbms = dlm&amp;nbsp; replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;delimiter = '09'x;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 19:08:47 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2020-02-07T19:08:47Z</dc:date>
    <item>
      <title>Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623139#M183386</link>
      <description>&lt;P&gt;Hi, when I proc import a raw .txt file, a specific field (name of customer) cuts off at a certain length, other fields remain in their lengths, some longer.. No idea why.&amp;nbsp; Please help !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my proc import code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt; out = raw datafile = "S:\Banking\MIS\Reports\Report_&amp;amp;rpt_dt..txt"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;dbms = dlm&amp;nbsp; replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;delimiter = '09'x;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623139#M183386</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2020-02-07T19:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623141#M183388</link>
      <description>&lt;P&gt;I think we'd need for you to share a part of this .txt file in order to provide any advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please remember that PROC IMPORT is a guessing procedure; it guesses at the lengths of fields, and sometimes gets it wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623141#M183388</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-07T19:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623144#M183390</link>
      <description>&lt;P&gt;Good idea, however I can't due to very sensitive personal information..&amp;nbsp; Is there a different way?&amp;nbsp; Can I specify the length in the proc import for that specific field?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623144#M183390</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2020-02-07T19:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623146#M183391</link>
      <description>&lt;P&gt;You could add to your PROC IMPORT the following statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;guessingrows=max;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For an extremely large input file, this may cause the processing time to double.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623146#M183391</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-07T19:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623148#M183393</link>
      <description>&lt;P&gt;Don't force SAS to guess what your variables are and how to define them.&amp;nbsp; Especially if you are going to read the same data layout for many different dates.&amp;nbsp; When PROC IMPORT guesses the only information it has is the one example file it is currently reading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Write your own data step so that you have control.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw;
  infile "S:\Banking\MIS\Reports\Report_&amp;amp;rpt_dt..txt" firstobs=2 truncover dsd dlm='09'x;
  length firstvar $100 var2 8 lastvar $40 ;
  input firstvar -- lastvar ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you really don't know what the variables are you could copy the names from the first line of the file.&amp;nbsp; Or copy the names that PROC IMPORT generated.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623148#M183393</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-07T19:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623151#M183395</link>
      <description>&lt;P&gt;Proc import creates a data step which you can find in the log; copy it from there, and adapt it to the real variable attributes. Use it in the future, if you have to read the same structure again.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 19:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623151#M183395</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-07T19:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Importing cuts-off field length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623166#M183403</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1797"&gt;@podarum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Good idea, however I can't due to very sensitive personal information..&amp;nbsp; Is there a different way?&amp;nbsp; Can I specify the length in the proc import for that specific field?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are your column headings that sensitive? Since your question revolver around how the column headings are read that is the import element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: if you have a text file, import 1 file. Look in the log and copy the generated data step to the editor and clean up the code.&lt;/P&gt;
&lt;P&gt;Then you can may changes such as fixing variable names, types and lengths that will change from Proc Import runs.&lt;/P&gt;
&lt;P&gt;Then replace the file name in the INFILE statement and the name of the output data set to read each file.&lt;/P&gt;
&lt;P&gt;Now &lt;STRONG&gt;you&lt;/STRONG&gt; control the names and content of the SAS data set instead of letting a guessing routine control things.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 20:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-cuts-off-field-length/m-p/623166#M183403</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-07T20:44:36Z</dc:date>
    </item>
  </channel>
</rss>

