<?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: character length in variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/485017#M125965</link>
    <description>&lt;P&gt;You can simplify your code by using informats with a colon, and formatting price in the same step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input items :$20. price description :$85. calorieskl;
format price dollar10.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The length statements can now be omitted.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 06:53:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-08T06:53:55Z</dc:date>
    <item>
      <title>character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484987#M125942</link>
      <description>&lt;P&gt;hi there!.&lt;/P&gt;&lt;P&gt;how to print entire content of particular character varible&lt;/P&gt;&lt;P&gt;for example i need to print like " my name is alphapet and place is world " on entire column&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484987#M125942</guid>
      <dc:creator>navinrraj</dc:creator>
      <dc:date>2018-08-08T05:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484990#M125944</link>
      <description>&lt;P&gt;The length of a character variable is set the first time the data step meets the variable. Therefore, make sure that the length of the variable is large enough to meet your needs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a small example, here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1;
   string="abc";output;
   string=" my name is alphapet and place is world ";output;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the length of String is three. Therefore&amp;nbsp;the string you want to have in a variable is truncated. Instead, we can make sure the no truncation happens by setting a large enough length like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test2;
   length string $200;
   string="abc";output;
   string=" my name is alphapet and place is world ";output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484990#M125944</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-08T05:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484994#M125947</link>
      <description>Thanks and how to do it tat from infile methid&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484994#M125947</guid>
      <dc:creator>navinrraj</dc:creator>
      <dc:date>2018-08-08T05:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484995#M125948</link>
      <description>&lt;P&gt;Post the code you already have, and we can show you where to improve it.&lt;/P&gt;
&lt;P&gt;If you read from an external file, include an example for that.&lt;/P&gt;
&lt;P&gt;See my footnotes for hints on posting code; use the {i} button to post lines from the external file.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 05:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/484995#M125948</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-08T05:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/485002#M125952</link>
      <description>&lt;P&gt;data breakfast;&lt;/P&gt;&lt;P&gt;length items $20;&lt;/P&gt;&lt;P&gt;length description $85;&lt;/P&gt;&lt;P&gt;infile"/home/naveence0/food.txt" dlm='|';&lt;/P&gt;&lt;P&gt;input items$ price description$ calorieskl;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = breakfast;&lt;/P&gt;&lt;P&gt;data breakfast;&lt;/P&gt;&lt;P&gt;set breakfast;output;&lt;/P&gt;&lt;P&gt;format price DOLLAR10.2;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data= breakfast;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 06:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/485002#M125952</guid>
      <dc:creator>navinrraj</dc:creator>
      <dc:date>2018-08-08T06:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: character length in variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/485017#M125965</link>
      <description>&lt;P&gt;You can simplify your code by using informats with a colon, and formatting price in the same step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input items :$20. price description :$85. calorieskl;
format price dollar10.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The length statements can now be omitted.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 06:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/character-length-in-variable/m-p/485017#M125965</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-08T06:53:55Z</dc:date>
    </item>
  </channel>
</rss>

