<?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: Importation crops last variable for no apparent reason in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284011#M19440</link>
    <description>&lt;P&gt;Yes, I'm using SAS EG 5.1, I'm really not aware of the different SAS that exist, hence the misinformation. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You got it right, it's exactly the LRECL parameter that was screwing things up. I had it at 324 because that's what the generated code had in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use : as a delimiter because that's what people use around here (at work). I wasn't aware that commas are more conventional, but I really can't see how that matters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ?? are there because, again, the generated code had it too. As you can guess, I don't know what I'm doing. I'm learning by seeing examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all the tips and the answer.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2016 12:30:02 GMT</pubDate>
    <dc:creator>sleretrano</dc:creator>
    <dc:date>2016-07-13T12:30:02Z</dc:date>
    <item>
      <title>Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284002#M19437</link>
      <description>&lt;P&gt;I'm on SAS version 5.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to import a text file into SAS. Using SAS Guide everything works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the code generated by this importation, almost everything is fine. The last variable, however, is cropped. It's supposed to be a three digit number, but after the imporation I get a single digit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample of the code I'm using (I greatly reduced the number of variables which I suppose is only chaff).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA WORK.Output;
    LENGTH
        Var1            8
	Var2            8 ;
    FORMAT
        Var1        BEST12.
	Var2        BEST3. ;
    INFORMAT
        Var1        BEST12.
	Var2        BEST3. ;
    INFILE "Path"
 	LRECL=324
    DLM=':'
    MISSOVER
    DSD ;

    INPUT
        Var1        : ?? BEST12.
	Var2        : ?? BEST3. ;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any clues about what's happening? How can I fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 11:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284002#M19437</guid>
      <dc:creator>sleretrano</dc:creator>
      <dc:date>2016-07-13T11:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284005#M19438</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imagine you mean you are using EG 5.1 (SAS is currently at 9.4). &amp;nbsp;It is likely to be this line:&lt;/P&gt;
&lt;PRE&gt;LRECL=324&lt;/PRE&gt;
&lt;P&gt;Which limits the characters per line to 324, any reason why you put this in, most of the time I would leave it out or set to 32767.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also some tips:&lt;/P&gt;
&lt;P&gt;Why are you using a : as a delimiter? &amp;nbsp;Comma would be the normal, but occasionally pipe could be used. &amp;nbsp;Seems odd.&lt;/P&gt;
&lt;P&gt;Why read in variables with ?? - this just seems like you don't know what data is going to come in?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No need to code all in uppercase - its quite hard to read, and use spaces to indent rather than tabs which render differently between applications.&lt;/P&gt;
&lt;P&gt;So your code could be written as:&lt;/P&gt;
&lt;PRE&gt;data work.output;&lt;BR /&gt; length var1 var2 8;&lt;BR /&gt; format var1 best12. var2 best3.;&lt;BR /&gt; informat var1 best12. var2 best3.;&lt;BR /&gt; infile "path" lrecl=32767 dlm=':' missover dsd;&lt;BR /&gt; input var1 var2;&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284005#M19438</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-13T12:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284010#M19439</link>
      <description>&lt;P&gt;Your problem is likely related to TERMSTR&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/14/178.html" target="_blank"&gt;http://support.sas.com/kb/14/178.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS is probably reading CR '0d'x as the last character in field 2, which is not valid in a number field. &amp;nbsp;Your use of ?? to suppress the associated messages are preventing you from seeing what is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try adding&amp;nbsp;TERMSTR=CRLF on the INFILE statement.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284010#M19439</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-07-13T12:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284011#M19440</link>
      <description>&lt;P&gt;Yes, I'm using SAS EG 5.1, I'm really not aware of the different SAS that exist, hence the misinformation. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You got it right, it's exactly the LRECL parameter that was screwing things up. I had it at 324 because that's what the generated code had in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use : as a delimiter because that's what people use around here (at work). I wasn't aware that commas are more conventional, but I really can't see how that matters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ?? are there because, again, the generated code had it too. As you can guess, I don't know what I'm doing. I'm learning by seeing examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all the tips and the answer.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284011#M19440</guid>
      <dc:creator>sleretrano</dc:creator>
      <dc:date>2016-07-13T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284014#M19441</link>
      <description>&lt;P&gt;Actually I did try that, but it didn't work.&lt;/P&gt;&lt;P&gt;The DLM SAS generated was '7F'x though, not CR '0d'x, if that matters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284014#M19441</guid>
      <dc:creator>sleretrano</dc:creator>
      <dc:date>2016-07-13T12:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Importation crops last variable for no apparent reason</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284035#M19442</link>
      <description>&lt;P&gt;Just to add, Comma Separated Variable files - whilst officially documented as a standard - is widely used around the world for data transfer. &amp;nbsp;If you open a CSV in Excel it will automatically populate values into columns for instance. &amp;nbsp;The : is used in different ways for different applications, and so could be confusing. &amp;nbsp;Its fine if its just within your company, unless anyone new joins, but going outside...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Comma-separated_values" target="_blank"&gt;https://en.wikipedia.org/wiki/Comma-separated_values&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 14:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importation-crops-last-variable-for-no-apparent-reason/m-p/284035#M19442</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-07-13T14:10:22Z</dc:date>
    </item>
  </channel>
</rss>

