<?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: How to specify character length when creating data set using proc input. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771247#M30948</link>
    <description>&lt;P&gt;Best practice is to define the variable before using it so that SAS does not have to guess how you want it defined.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;     
  length percent 8 cPLTL $20 ;
  input percent cPLTL ;     
cards;     
2.19 cPLTL     
17.03 non-cPLTL      
;    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS: Do not indent lines of in-line data.&amp;nbsp; To remind you not to intend the data do not indent the CARDS/DATATLINE statement either.&lt;/P&gt;
&lt;P&gt;PPS: Do not insert physical tab characters into data lines. You also shouldn't be inserting tabs into lines of program code as they are invisible to humans and can end up in the middle of the lines and result in really strangely formatted code.&amp;nbsp; Instead take advantage of the editor's ability to translate you hitting the TAB key into inserting the correct number of spaces you like to use.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Sep 2021 21:01:44 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-09-29T21:01:44Z</dc:date>
    <item>
      <title>How to specify character length when creating data set using proc input.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771236#M30945</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;I am using SAS OnDemand for Academics. I am trying to make a simple data set using the following code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;     
	input percent cPLTL $ @@;     
	cards;     
	2.19 cPLTL     
	17.03 non-cPLTL      
	;         
proc print data=new; run;  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which yields these results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mcmaxwell_0-1632947499520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64236iA1DD5D3FEDD0F101/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mcmaxwell_0-1632947499520.png" alt="mcmaxwell_0-1632947499520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How do I specify the character length of the "cPLTL" variable so that the last L in "non-cPLTL" won't be cut off? I tried adding the number 9 after the $ in the input function, but then the Studio kept running the code and never produced any results...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 20:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771236#M30945</guid>
      <dc:creator>mcmaxwell</dc:creator>
      <dc:date>2021-09-29T20:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify character length when creating data set using proc input.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771240#M30946</link>
      <description>&lt;P&gt;Use the informat with a modifier:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input percent cPLTL :$9.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Sep 2021 20:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771240#M30946</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-29T20:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify character length when creating data set using proc input.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771247#M30948</link>
      <description>&lt;P&gt;Best practice is to define the variable before using it so that SAS does not have to guess how you want it defined.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;     
  length percent 8 cPLTL $20 ;
  input percent cPLTL ;     
cards;     
2.19 cPLTL     
17.03 non-cPLTL      
;    &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS: Do not indent lines of in-line data.&amp;nbsp; To remind you not to intend the data do not indent the CARDS/DATATLINE statement either.&lt;/P&gt;
&lt;P&gt;PPS: Do not insert physical tab characters into data lines. You also shouldn't be inserting tabs into lines of program code as they are invisible to humans and can end up in the middle of the lines and result in really strangely formatted code.&amp;nbsp; Instead take advantage of the editor's ability to translate you hitting the TAB key into inserting the correct number of spaces you like to use.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 21:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-specify-character-length-when-creating-data-set-using/m-p/771247#M30948</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-29T21:01:44Z</dc:date>
    </item>
  </channel>
</rss>

