<?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: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6 in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358601#M2511</link>
    <description>&lt;P&gt;In your word doc it looks like you have TABS at the beginning of your data lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	datalines;
	Anna
	Christopher
	;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can probably avoid making this mistake again if you remember to always start the DATALINES (or CARDS) statement in column one so the SAS editor will default to starting the actual lines of data in column one also.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;datalines;
Anna
Christopher
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 14 May 2017 20:29:59 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2017-05-14T20:29:59Z</dc:date>
    <item>
      <title>problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358561#M2503</link>
      <description>&lt;P&gt;When I try to get the size of a char variable, I have to return the size plus 1.&lt;/P&gt;&lt;P&gt;The variable size is wrong !!!&lt;/P&gt;&lt;P&gt;This is a bug ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More details in file atached ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 15:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358561#M2503</guid>
      <dc:creator>MaxOne</dc:creator>
      <dc:date>2017-05-14T15:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358562#M2504</link>
      <description>&lt;P&gt;What happens if you use a HEX Format on the variable?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect there's a 'invisible blank' in your data somehow.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 15:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358562#M2504</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-14T15:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358564#M2505</link>
      <description>&lt;P&gt;I suspect the extra 1 is the Windows end of line character. On Demand is Unix system.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 15:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358564#M2505</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-14T15:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358565#M2506</link>
      <description>&lt;P&gt;Thanks, I did try resset the code and data, but the problem not resolved yet.&lt;/P&gt;&lt;P&gt;I await for solution ..&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 15:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358565#M2506</guid>
      <dc:creator>MaxOne</dc:creator>
      <dc:date>2017-05-14T15:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358579#M2507</link>
      <description>&lt;P&gt;I can't replicate your issue on On Demand. I did test it SAS On Demand, not SAS UE or SAS Studio installed on my desktop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the correct values, but I'm on a Unix system (a Mac). I strongly suspect the invisible character issue mentioned earlier. Post the output using the hex editor. &amp;nbsp;I've added the relevant code below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future post your output directly into the forum, not with an attachment, many users won't bother to download an attachment so it takes longer to get answers since they simply won't respond or will wait for you to post directly to the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data WRONG_LENGTH;
 Input Name $20. ;
 v_length=length(name) ;
 y=put(name, hex20.);
 datalines  ;
 Anna  
 Christopher  
 Mary  
 Jonathan  
 Tim  
 Elizabeth  
 Amy  
 schwarzenegger  
 Kevin  
 Porter       
 ; 
 RUN ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8874i64BEDEDE56631C02/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Screen Shot 2017-05-14 at 12.39.24 PM.png" title="Screen Shot 2017-05-14 at 12.39.24 PM.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 18:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358579#M2507</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-14T18:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358585#M2508</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When you code the NAME $20. in the INPUT statement, you are probably reading the end of record marker for the DATALINES. There is a very simple way to change that. Please see the attached examples. Altering your INPUT statement and adding a LENGTH statement results in both operating systems having the same length, as shown below.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8875i2E508544E9829702/image-size/original?v=1.0&amp;amp;px=-1" alt="correct_lengths_change_INPUT.png" title="correct_lengths_change_INPUT.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, the LENGTH statement specifies the MAXIMUM length for the variable and establishes the size of the variable in the descriptor portion of the dataset and the simplified LIST input statement (INPUT NAME $;) instructs SAS to read until a space (the default delimiter is encountered or the end of record mark is encountered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 18:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358585#M2508</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-05-14T18:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358601#M2511</link>
      <description>&lt;P&gt;In your word doc it looks like you have TABS at the beginning of your data lines.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	datalines;
	Anna
	Christopher
	;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can probably avoid making this mistake again if you remember to always start the DATALINES (or CARDS) statement in column one so the SAS editor will default to starting the actual lines of data in column one also.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;datalines;
Anna
Christopher
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 May 2017 20:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358601#M2511</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-14T20:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358613#M2512</link>
      <description>&lt;P&gt;&lt;IMG title="code.jpg" alt="code.jpg" src="https://communities.sas.com/t5/image/serverpage/image-id/8880iFD710C268475DEA3/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code below is with &amp;lt; TAB &amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG width="547" height="548" title="length_error.jpg" alt="length_error.jpg" src="https://communities.sas.com/t5/image/serverpage/image-id/8879i2A5FDA8676EC870C/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code without &amp;lt;TAB&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="code_correct.jpg" alt="code_correct.jpg" src="https://communities.sas.com/t5/image/serverpage/image-id/8881iC66035E76A4554A6/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, works correctly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG title="Output_Data.jpg" alt="Output_Data.jpg" src="https://communities.sas.com/t5/image/serverpage/image-id/8882i213E8FF34DDEB177/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct !!!&lt;BR /&gt;The problem was have Displaced this items in editor with the &amp;lt; TAB &amp;gt;, when I move left this items to left with &amp;lt;BACKSPACE&amp;gt; this problem was resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much ...&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 21:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358613#M2512</guid>
      <dc:creator>MaxOne</dc:creator>
      <dc:date>2017-05-14T21:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with length of variable when using INPUT WITH DATALINES in SAS STUDIO ON DEMAND 3.6</title>
      <link>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358614#M2513</link>
      <description>&lt;P&gt;Notice the HEX shows this. 09 - which is tab - at the front of every variable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2017 21:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/problem-with-length-of-variable-when-using-INPUT-WITH-DATALINES/m-p/358614#M2513</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-14T21:47:17Z</dc:date>
    </item>
  </channel>
</rss>

