<?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: Pseudo code in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6078#M2433</link>
    <description>the coalesce function might be your answer; it returns the first non-null argument and works in data step and in proc sql:&lt;BR /&gt;
&lt;BR /&gt;
data coalesce;&lt;BR /&gt;
  input x y;&lt;BR /&gt;
  z = coalesce(x,y);&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2&lt;BR /&gt;
. 3&lt;BR /&gt;
4 .&lt;BR /&gt;
. .&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select x, y, coalesce(x,y) as z&lt;BR /&gt;
  from coalesce&lt;BR /&gt;
  ;&lt;BR /&gt;
quit;</description>
    <pubDate>Fri, 28 Dec 2007 18:26:41 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-12-28T18:26:41Z</dc:date>
    <item>
      <title>Pseudo code</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6076#M2431</link>
      <description>I have some logic that I am trying to do in SAS but not sure how to do this.&lt;BR /&gt;
&lt;BR /&gt;
If Component_Product_ID is missing then ICIS_Product_ID else Component_Product_ID.  This is the definition (calculation) for a field called Pseudo_Pr_ID.&lt;BR /&gt;
&lt;BR /&gt;
I have some SQL from another program that uses DECODE:&lt;BR /&gt;
DECODE(T3."COMPONENT_PRODUCT_ID",NULL,T3."ICIS_PRODUCT_ID" ,T3."COMPONENT_PRODUCT_ID")&lt;BR /&gt;
&lt;BR /&gt;
Would a CASE statement work? If so, how would the syntax be.</description>
      <pubDate>Fri, 28 Dec 2007 17:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6076#M2431</guid>
      <dc:creator>lloraine</dc:creator>
      <dc:date>2007-12-28T17:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pseudo code</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6077#M2432</link>
      <description>I think a CASE statement would work.&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select case when Component_Product_ID = . then ICIS_Product_ID else Component_Product_ID end as Pseudo_Pr_ID&lt;BR /&gt;
  from . . .&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 28 Dec 2007 17:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6077#M2432</guid>
      <dc:creator>1162</dc:creator>
      <dc:date>2007-12-28T17:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pseudo code</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6078#M2433</link>
      <description>the coalesce function might be your answer; it returns the first non-null argument and works in data step and in proc sql:&lt;BR /&gt;
&lt;BR /&gt;
data coalesce;&lt;BR /&gt;
  input x y;&lt;BR /&gt;
  z = coalesce(x,y);&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2&lt;BR /&gt;
. 3&lt;BR /&gt;
4 .&lt;BR /&gt;
. .&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select x, y, coalesce(x,y) as z&lt;BR /&gt;
  from coalesce&lt;BR /&gt;
  ;&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 28 Dec 2007 18:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Pseudo-code/m-p/6078#M2433</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-12-28T18:26:41Z</dc:date>
    </item>
  </channel>
</rss>

