<?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: Numerical value for a compressed function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508221#M136458</link>
    <description>&lt;P&gt;assuming the number has no decimal digits then use otherwise adapt informat&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    num = input(compress(text,,'kd') , best8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Oct 2018 02:16:07 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-10-29T02:16:07Z</dc:date>
    <item>
      <title>Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508215#M136453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have compressed the following - "Box 0f 6 widgets" to give me "6" in a separate column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to multiply this number with average price but the calcs give me an error "need a numercial value to use * multiplication".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway to fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 01:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508215#M136453</guid>
      <dc:creator>Nikhil28</dc:creator>
      <dc:date>2018-10-29T01:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508216#M136454</link>
      <description>&lt;P&gt;Can you post the sample of your data,code, log and the desired output plz&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 02:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508216#M136454</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-29T02:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508219#M136456</link>
      <description>&lt;P&gt;Instead of something like&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; STR= compress( VAR,,'dk');&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;that you must have right now, use&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; NUM= input( compress( VAR,,'dk'), 32.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;to create a numeric variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 02:11:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508219#M136456</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-29T02:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508220#M136457</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;nice point but i would have thought autoconversion would have only resulted in a note while OP says received an error?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 02:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508220#M136457</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-29T02:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508221#M136458</link>
      <description>&lt;P&gt;assuming the number has no decimal digits then use otherwise adapt informat&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    num = input(compress(text,,'kd') , best8.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 02:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508221#M136458</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-10-29T02:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508222#M136459</link>
      <description>'kd' stands for Keep Digits</description>
      <pubDate>Mon, 29 Oct 2018 02:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508222#M136459</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-10-29T02:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508224#M136461</link>
      <description>&lt;P&gt;1 The SAS System 08:54 Monday, October 29, 2018&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 OPTION DEBUG=DBMS_SELECT SQL_IP_TRACE=(NOTE, SOURCE);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4 PROC SQL NOEXEC;&lt;BR /&gt;5 SELECT (NUM= input( COMPRESS(t1.NON_WAREHOUSE_UOM, ,'dk') , 32.)) AS CALCULATION&lt;BR /&gt;6 FROM WORK.QUERY_FOR_PURCHASING_0000 t1;&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: NUM.&lt;BR /&gt;7 QUIT;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;8 %PUT SQL_IPTRACE_RESULT=&amp;amp;SYS_SQL_IP_ALL;&lt;BR /&gt;SQL_IPTRACE_RESULT=-1&lt;BR /&gt;9 OPTIONS SQL_IP_TRACE=(NONE);&lt;BR /&gt;10 QUIT; RUN;&lt;BR /&gt;11&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 02:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508224#M136461</guid>
      <dc:creator>Nikhil28</dc:creator>
      <dc:date>2018-10-29T02:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508227#M136462</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;No automatic conversion&amp;nbsp;in SQL.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 03:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508227#M136462</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-29T03:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Numerical value for a compressed function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508229#M136464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235507"&gt;@Nikhil28&lt;/a&gt;&amp;nbsp;Please try harder.&lt;/P&gt;
&lt;P&gt;You removed the semi-colon when transforming my generic statement into a SQL variable formula.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to remove the value assignment&amp;nbsp;syntax to build&amp;nbsp;your SQL query&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;SELECT&amp;nbsp; input( COMPRESS(t1.NON_WAREHOUSE_UOM, ,'dk') , 32.)&amp;nbsp; AS CALCULATION&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You obviously know how to write SQL, so please don't ask us to guide you through each baby step.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 03:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numerical-value-for-a-compressed-function/m-p/508229#M136464</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-29T03:46:47Z</dc:date>
    </item>
  </channel>
</rss>

