<?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: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193195#M266275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Difficult to diagnose on an excerpt. Post the entire query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you can always (not sure) replace a calculated variable with the original expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 May 2015 17:09:51 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-05-26T17:09:51Z</dc:date>
    <item>
      <title>How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193191#M266271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a sql procedure with about 5 "case whens" (case when _ then _ else _ end as _ ). I'm trying to figure out how I can take a variable created in the "end as _ " portion of the previous case statement and use it in the "case when _ " portion of the next case statement within the same proc sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;case&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.type = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Non-Agency'&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;then&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Non-Agency'&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Municipal'&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;then&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Municipal'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;else&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Agency'&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;as&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff0000;"&gt; Shock&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;case&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff0000;"&gt; Shock&lt;/SPAN&gt; = &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'Non-Agency'&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;and&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat = l.breakdown &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;then&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; l.Cat&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;else&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #00b700; font-family: Courier New;"&gt;'None'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;end &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;as&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; Lookup,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;So above, the first case statement creates the variable Shock. I want to reference Shock in the next case statement. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;But the log says "&lt;/SPAN&gt;ERROR: The following columns were not found in the contributing tables: Shock."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides starting a 2nd proc sql, how can I get around this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 15:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193191#M266271</guid>
      <dc:creator>jtevans1019</dc:creator>
      <dc:date>2015-05-26T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193192#M266272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the keyword &lt;STRONG&gt;calculated&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Courier New'; color: #808080; text-decoration: underline; background-color: #ffffff;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-size: 13px; font-family: 'Courier New'; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt; Calculated Shock&lt;/SPAN&gt; = &lt;/SPAN&gt;&lt;STRONG style="font-size: 13px; font-family: 'Courier New'; color: #00b700; background-color: #ffffff;"&gt;'Non-Agency'&lt;/STRONG&gt;&lt;SPAN style="font-size: 13px; font-family: 'Courier New'; background-color: #ffffff;"&gt; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Courier New'; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Courier New'; background-color: #ffffff;"&gt;PG&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 15:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193192#M266272</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-05-26T15:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193193#M266273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 16:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193193#M266273</guid>
      <dc:creator>jtevans1019</dc:creator>
      <dc:date>2015-05-26T16:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193194#M266274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Follow-up question. I'm now getting an error saying: ERROR: The following columns were not found as CALCULATED references in the immediate query:&amp;nbsp; Lookup1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could this be because I'm using "Calculated Lookup1" in the "from __ " section at the bottom of the code? How do I fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;case&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat = &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;&lt;STRONG style=": ; font-family: Courier New;"&gt;'Municipal'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;then&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.credit_rtng&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;when&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat is &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;null&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;and&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; (a.FAS115 || a.type || a.breakdown) = (l.FAS115 || l.type || l.breakdown) &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;then&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; l.FHFA_Template &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;else&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;end &lt;/SPAN&gt;&lt;STRONG style=": ; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;as&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt; Lookup1&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;case &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;when&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt; Calculated Lookup1&lt;/STRONG&gt;&lt;/SPAN&gt; = m.Rating &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; m.Sev_Spread_bps &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #ff00ff; font-family: Courier New;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-family: Courier New;"&gt;end &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Muni_Shock, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;case&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;when&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; n.breakdown1 = Calculated Lookup2 &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; n.breakdown3 = &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Calculated Lookup1 &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; n.rating = a.credit_rtng&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; n.vintage = a.vintage_yr &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; n.Sev_MV_Shock &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #ff00ff; font-family: Courier New;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Courier New;"&gt;end &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;as&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; NonAgency_Shock,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-family: Courier New;"&gt;from &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;GMSCusip.afs_group_master_bd a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Lookup l &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.breakdown = l.breakdown &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.FAS115 = l.FAS115 &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.type = l.type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; GMS gm &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.breakdown = gm.breakdown&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; AgencyShock ag &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt; Calculated Lookup1&lt;/STRONG&gt;&lt;/SPAN&gt; = ag.Product&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; MuniShock m &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt; Calculated Lookup1&lt;/STRONG&gt;&lt;/SPAN&gt; = m.Rating&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; NonAgencyShock n &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt; Calculated Lookup1&lt;/STRONG&gt;&lt;/SPAN&gt; = n.breakdown3 &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.vintage_yr = n.vintage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193194#M266274</guid>
      <dc:creator>jtevans1019</dc:creator>
      <dc:date>2015-05-26T17:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193195#M266275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Difficult to diagnose on an excerpt. Post the entire query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you can always (not sure) replace a calculated variable with the original expression. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193195#M266275</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-05-26T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use previously created case variable (end as x) in new case statement (case when x) in same proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193196#M266276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks PGStats. I put the original expression in the from section in place of "Calculated Lookup1". Now it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;from GMSCusip.afs_group_master_bd a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; Lookup l &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.breakdown = l.breakdown &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.FAS115 = l.FAS115 &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.type = l.type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; GMS gm &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.breakdown = gm.breakdown&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;left &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;join&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; AgencyShock ag &lt;/SPAN&gt;&lt;SPAN style="; color: #808080; font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;on&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; ag.Product = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (case &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;when&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat = &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt;&lt;STRONG&gt;'Municipal'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.credit_rtng&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;when&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat is &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;null&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; (a.FAS115 || a.type || a.breakdown) = (l.FAS115 || l.type || l.breakdown) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; l.FHFA_Template &lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; text-decoration: underline;"&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New;"&gt; a.Cat&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;end)&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 17:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-previously-created-case-variable-end-as-x-in-new-case/m-p/193196#M266276</guid>
      <dc:creator>jtevans1019</dc:creator>
      <dc:date>2015-05-26T17:32:02Z</dc:date>
    </item>
  </channel>
</rss>

