<?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: format assignment for computedvars in cas actions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/850366#M336077</link>
    <description>&lt;P&gt;Is there some reason you attached the $CHAR format to the variable?&amp;nbsp; Does it have leading spaces that you want SAS to preserve when it prints the values?&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 19:08:08 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-12-19T19:08:08Z</dc:date>
    <item>
      <title>format assignment for computedvars in cas actions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/849850#M335935</link>
      <description>&lt;P&gt;I want the newly created variable "combi" to hold the complete string, but it cuts off at length 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
   session mysession;
   simple.topk /                           
      inputs={"from_gama_agg", "combi"}, topk=5 bottomk=0  aggregator="n"     
      table={
         name="LONGDRIVE_TS", CASLIB="onair"
         where="_FECFACTU=_FULTPATA", 
         computedVars={{name="combi", format='$char44.'}},
         computedVarsProgram="combi=ifc(modsermt in ('D1' 'D2'), 'Mto &amp;amp; desgaste', 'Mto')",                     
         groupBy={"from_brand"}};
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 12:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/849850#M335935</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-12-15T12:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: format assignment for computedvars in cas actions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/850345#M336071</link>
      <description>&lt;P&gt;This can be fixed by adding a LENGTH statement to your COMPUTEDVARSPROGRAM, something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
   session mysession;
   simple.topk /                           
      inputs={"from_gama_agg", "combi"}, topk=5 bottomk=0  aggregator="n"     
      table={
         name="LONGDRIVE_TS", CASLIB="onair"
         where="_FECFACTU=_FULTPATA", 
         computedVars={{name="combi", format='$char44.'}},
         computedVarsProgram="length combi varchar(44); combi=ifc(modsermt in ('D1' 'D2'), 'Mto &amp;amp; desgaste', 'Mto')",                     
         groupBy={"from_brand"}};
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 13:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/850345#M336071</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-12-19T13:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: format assignment for computedvars in cas actions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/850366#M336077</link>
      <description>&lt;P&gt;Is there some reason you attached the $CHAR format to the variable?&amp;nbsp; Does it have leading spaces that you want SAS to preserve when it prints the values?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 19:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-assignment-for-computedvars-in-cas-actions/m-p/850366#M336077</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-19T19:08:08Z</dc:date>
    </item>
  </channel>
</rss>

