<?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 avoid values getting truncated when creating a new calculated column? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418838#M102928</link>
    <description>&lt;P&gt;after the SET statement, you need a LENGTH statement to specify the maximum length of the variable. If you don't it sets the length by the length of the first time the variable is assigned a value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;length payband $ 6;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Dec 2017 15:53:39 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-12-06T15:53:39Z</dc:date>
    <item>
      <title>How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418836#M102926</link>
      <description>&lt;P&gt;I am self learning SAS and am stuck in a very basic Issue.&lt;/P&gt;&lt;P&gt;Kindly refer to the code:&lt;/P&gt;&lt;PRE&gt;data work.empsal1;
set work.empsal;
if salary &amp;lt; 20000 then PAYBAND = "LOW" ;
ELSE IF 20000 &amp;lt;= SALARY &amp;lt; 30000 THEN PAYBAND = "MEDIUM";
ELSE PAYBAND = "HIGH";
RUN;&lt;/PRE&gt;&lt;P&gt;The values in the PAYBAND column is appearing as 'LOW', 'MED', 'HIG'&lt;/P&gt;&lt;P&gt;How to fix It.&lt;/P&gt;&lt;P&gt;It is very basic issue but as I have no direct tutor I cannot solve it. Plz help.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 15:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418836#M102926</guid>
      <dc:creator>avijit_p</dc:creator>
      <dc:date>2017-12-06T15:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418838#M102928</link>
      <description>&lt;P&gt;after the SET statement, you need a LENGTH statement to specify the maximum length of the variable. If you don't it sets the length by the length of the first time the variable is assigned a value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;length payband $ 6;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 15:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418838#M102928</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-12-06T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418866#M102942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181296"&gt;@avijit_p&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is very basic issue but as I have no direct tutor I cannot solve it. Plz help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;People get direct tutors?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418866#M102942</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-06T16:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418868#M102944</link>
      <description>&lt;P&gt;A very important part of SAS is the Format of variable. The format displays desired text and for almost all of the analysis procedures will use the formatted values for categories. The very fun part is that you can create formats as needed. That will allow you to create multiple displays or analysis from the same variable without having to create multiple variables as long as you only need one category set per procedure for a given variable.&lt;/P&gt;
&lt;P&gt;Consider:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value payband
low   - &amp;lt; 20000 = 'LOW'
20000 - &amp;lt; 30000 = 'MEDIUM'
30000 - HIGH   = 'HIGH'
;
value alpayband
0  - &amp;lt; 20000 = 'LOW'
20000 - &amp;lt; 30000 = 'MEDIUM'
30000 - &amp;lt; 50000 = 'Higher'
50000 - High = 'HIGHEST'
;

run;

proc freq data=work.empsal;
   tables salary;
   format salary payband.;
run;

proc freq data=work.empsal;
   tables salary;
   format salary altpayband.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418868#M102944</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-06T16:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418871#M102946</link>
      <description>&lt;P&gt;The first SAS e-course is free and covers topics like this. There's also&amp;nbsp;&lt;/P&gt;
&lt;P&gt;video.sas.com -&amp;gt; How To&amp;gt;&amp;nbsp; Analytics U&lt;/P&gt;
&lt;P&gt;&lt;A href="http://video.sas.com/#category/videos/sas-analytics-u" target="_blank"&gt;http://video.sas.com/#category/videos/sas-analytics-u&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lots of videos that cover these topics.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/418871#M102946</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-06T16:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/419077#M103013</link>
      <description>&lt;P&gt;Thanks for the support.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 05:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/419077#M103013</guid>
      <dc:creator>avijit_p</dc:creator>
      <dc:date>2017-12-07T05:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid values getting truncated when creating a new calculated column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/419078#M103014</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;The videos would of a great help.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 05:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoid-values-getting-truncated-when-creating-a-new/m-p/419078#M103014</guid>
      <dc:creator>avijit_p</dc:creator>
      <dc:date>2017-12-07T05:13:39Z</dc:date>
    </item>
  </channel>
</rss>

