<?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 proc format invalue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324661#M72087</link>
    <description>&lt;P&gt;I am trying to use the below code to select where the field 'test' equals 2 and 3, based on the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value product&lt;BR /&gt;2,3 = '1'&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;infile cards;&lt;BR /&gt;input test;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where put(test,product.) = '1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I close to something that works here, or does proc format not work like this?&amp;nbsp; My WANT and HAVE datasets are the same.&amp;nbsp; I'd like the format to filter and only keep the 2,3.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 18:50:13 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2017-01-13T18:50:13Z</dc:date>
    <item>
      <title>proc format invalue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324661#M72087</link>
      <description>&lt;P&gt;I am trying to use the below code to select where the field 'test' equals 2 and 3, based on the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value product&lt;BR /&gt;2,3 = '1'&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;infile cards;&lt;BR /&gt;input test;&lt;BR /&gt;cards;&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where put(test,product.) = '1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I close to something that works here, or does proc format not work like this?&amp;nbsp; My WANT and HAVE datasets are the same.&amp;nbsp; I'd like the format to filter and only keep the 2,3.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324661#M72087</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2017-01-13T18:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc format invalue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324667#M72089</link>
      <description>&lt;P&gt;You're still capturing the value 1. Add an other condition, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt;value product&lt;BR /&gt;2,3 = '1'&lt;BR /&gt;other='0'&lt;BR /&gt;;run;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;infile cards;&lt;BR /&gt;input test;&lt;BR /&gt;cards;&lt;BR /&gt;0&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where put(test,product.) = '1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324667#M72089</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-13T18:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc format invalue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324668#M72090</link>
      <description>&lt;P&gt;If there isn't a value in the format it keeps the value, in this case it also happens to be a 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you add an OTHER to your format it will resolve as expected. This is VALUE, not INVALUE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
	value product 2, 3='1' other='0';
run;

data have;
	infile cards;
	input test;
	cards;
1
2
3
;
run;

data want;
	set have;
	where put(test, product.)='1';
	format test product.;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-invalue/m-p/324668#M72090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-13T18:57:33Z</dc:date>
    </item>
  </channel>
</rss>

