<?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: If '&amp;gt;' symbol we need to add +0.01, if  '&amp;lt;' we need to substract -0.01? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410640#M100339</link>
    <description>&lt;P&gt;An alternative which is easier to use once it is defined is a custom informat. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* Informat function to read numbers possibly prefixed with a
   lower than and greater than character.
   The number is read with the best. informat.
   The value returned is reduced (&amp;lt;) or increased (&amp;gt;) by 0.01, 
   if required */ 
proc fcmp outlib=work.fcmp.format;
function bestltgt(text $);
if first(text) = "&amp;lt;" then return (input(substr(text,2), best.) - 0.01);
if first(text) = "&amp;gt;" then return (input(substr(text,2), best.) + 0.01);
else if anyalpha(text) then return(.);
else return (input(text, best.));
endsub;
run;

options cmplib=(work.fcmp);

proc format;
invalue bestltgt(default=32) 
OTHER = [bestltgt()];
run;

data x;
input a bestltgt10.;
cards;
23
12
0.02
&amp;lt;10
&amp;gt;40
&amp;lt;12
&amp;lt;0
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 Nov 2017 04:18:41 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2017-11-05T04:18:41Z</dc:date>
    <item>
      <title>If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410613#M100319</link>
      <description>&lt;P&gt;data x;&lt;BR /&gt;input a $10.;&lt;BR /&gt;cards;&lt;BR /&gt;23&lt;BR /&gt;12&lt;BR /&gt;0.02&lt;BR /&gt;&amp;lt;10&lt;BR /&gt;&amp;gt;40&lt;BR /&gt;&amp;lt;12&lt;BR /&gt;&amp;lt;0&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If '&amp;gt;' symbol we need to add +0.01, if&amp;nbsp; '&amp;lt;' we need to substract -0.01. I have return a code can some one write more efficient then it....&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code::&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data x1;&lt;BR /&gt;set x;&lt;BR /&gt;if findc(a,'&amp;gt;')&amp;gt;0 then c=input(compress(a,'&amp;gt;&amp;lt;'),best.)+0.01;&lt;BR /&gt;else if findc(a,'&amp;lt;')&amp;gt;0 then c=input(compress(a,'&amp;gt;&amp;lt;'),best.)-0.01;&lt;BR /&gt;else if findc(a,'&amp;gt;&amp;lt;')=0 then c=input(a,best.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 23:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410613#M100319</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-04T23:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410623#M100326</link>
      <description>&lt;P&gt;If the symbols '&amp;lt;' and '&amp;gt;' only occurs as the first character then you can use the &lt;EM&gt;&lt;STRONG&gt;=:&lt;/STRONG&gt;&lt;/EM&gt; operator to make your code more compact, but not more efficient:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x1;
  set x;
  if      a=:'&amp;lt;' then c=input(compress(a,'&amp;gt;&amp;lt;'),best.)+0.01;
  else if a=:'&amp;gt;' then c=input(compress(a,'&amp;gt;&amp;lt;'),best.)-0.01;
  else                c=input(a,best.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Nov 2017 01:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410623#M100326</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-11-05T01:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410635#M100334</link>
      <description>what the ":" will do....</description>
      <pubDate>Sun, 05 Nov 2017 03:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410635#M100334</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-05T03:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410636#M100335</link>
      <description />
      <pubDate>Sun, 05 Nov 2017 03:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410636#M100335</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-05T03:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410637#M100336</link>
      <description>I understand it.....Thank you.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 05 Nov 2017 03:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410637#M100336</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-05T03:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410638#M100337</link>
      <description>Is another like ":" way if '&amp;lt;&amp;gt;' end's at last..</description>
      <pubDate>Sun, 05 Nov 2017 03:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410638#M100337</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-05T03:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410640#M100339</link>
      <description>&lt;P&gt;An alternative which is easier to use once it is defined is a custom informat. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/* Informat function to read numbers possibly prefixed with a
   lower than and greater than character.
   The number is read with the best. informat.
   The value returned is reduced (&amp;lt;) or increased (&amp;gt;) by 0.01, 
   if required */ 
proc fcmp outlib=work.fcmp.format;
function bestltgt(text $);
if first(text) = "&amp;lt;" then return (input(substr(text,2), best.) - 0.01);
if first(text) = "&amp;gt;" then return (input(substr(text,2), best.) + 0.01);
else if anyalpha(text) then return(.);
else return (input(text, best.));
endsub;
run;

options cmplib=(work.fcmp);

proc format;
invalue bestltgt(default=32) 
OTHER = [bestltgt()];
run;

data x;
input a bestltgt10.;
cards;
23
12
0.02
&amp;lt;10
&amp;gt;40
&amp;lt;12
&amp;lt;0
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Nov 2017 04:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410640#M100339</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-11-05T04:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: If '&gt;' symbol we need to add +0.01, if  '&lt;' we need to substract -0.01?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410642#M100340</link>
      <description>It's tricky too...but new to learn from it...Thank you...</description>
      <pubDate>Sun, 05 Nov 2017 04:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-gt-symbol-we-need-to-add-0-01-if-lt-we-need-to-substract-0-01/m-p/410642#M100340</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-11-05T04:54:26Z</dc:date>
    </item>
  </channel>
</rss>

