<?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 assign length to all character variables at a time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493494#M129826</link>
    <description>thanq&lt;BR /&gt;</description>
    <pubDate>Fri, 07 Sep 2018 15:18:31 GMT</pubDate>
    <dc:creator>thanikondharish</dc:creator>
    <dc:date>2018-09-07T15:18:31Z</dc:date>
    <item>
      <title>how to assign length to all character variables at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493442#M129809</link>
      <description>&lt;P&gt;data have ;&lt;BR /&gt;infile cards dlm=',' ;&lt;BR /&gt;input (a1-a4) ($10.) ;&lt;BR /&gt;cards ;&lt;BR /&gt;a ,b, c, d&lt;BR /&gt;;&lt;BR /&gt;is the above program correct to assign length to all character variables at a time&lt;BR /&gt;if it is wrong then how can i do?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 14:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493442#M129809</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-09-07T14:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to assign length to all character variables at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493451#M129813</link>
      <description>&lt;P&gt;The way to assign a length to a variable is to use a LENGTH statement. You can also use the LENGTH= attribute in an ATTRIB statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length A1-A4 $10 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to let the compiler GUESS&amp;nbsp;what length you want to use for your variables based on how you first use them then you could use your method of using an informat in the INPUT statement.&amp;nbsp; But for delimited data make sure to use the colon modifier to prevent the INPUT statement from using formatted input mode and messing up the parsing of the line around the delimiters.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  infile cards dsd dlm=','  truncover;
  input (a1-a4) (:$10.) ;
cards ;
a,b,c,d
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 14:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493451#M129813</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-09-07T14:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to assign length to all character variables at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493494#M129826</link>
      <description>thanq&lt;BR /&gt;</description>
      <pubDate>Fri, 07 Sep 2018 15:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-assign-length-to-all-character-variables-at-a-time/m-p/493494#M129826</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-09-07T15:18:31Z</dc:date>
    </item>
  </channel>
</rss>

