<?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: Proc Sql = Setting two variables equal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-Setting-two-variables-equal/m-p/339658#M77519</link>
    <description>&lt;P&gt;Whether your syntax is correct depends on the underlying data, which we cannot see.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the one piece of data you show, it looks like that REQ_DT is a datetime value, not a date value. Are you sure of whether all the variables you have are date and not date time and that you're comparing them correctly?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 15:09:24 GMT</pubDate>
    <dc:creator>collinelliot</dc:creator>
    <dc:date>2017-03-09T15:09:24Z</dc:date>
    <item>
      <title>Proc Sql = Setting two variables equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-Setting-two-variables-equal/m-p/339469#M77442</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to output a status code that was on an account at the same time a specific note code (SQ) was placed.&amp;nbsp; Here is the code I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
    create table Putback_Report as

SELECT
  ACCT_DIM.ACCT_NUM,
  ACTVT_RSLT_FACT.TRN_DT as REQ_DT,
  ACTVT_RSLT_FACT.TRN_CD as REQ_CD,
  &lt;STRONG&gt;ACCT_STATUS_HIST.STATUS_CD,&lt;/STRONG&gt;
  ACCT_DIM.ATTORNEY_CD,
  ATTORNEY_CD_LOOKUP.RECOVERER_CD_DESC

FROM
  RDWP0.ACCT_DIM,
  RDWP0.RECOVERER_CD_LOOKUP ATTORNEY_CD_LOOKUP,
  RDWP0.ACTVT_RSLT_FACT,
  RDWP0.ACCT_STATUS_HIST

WHERE
        ( ACCT_DIM.ACCT_ID=ACTVT_RSLT_FACT.ACCT_ID )
  AND   (ATTORNEY_CD_LOOKUP.RECOVERER_CD=ACCT_DIM.ATTORNEY_CD)
  AND   ACTVT_RSLT_FACT.TRN_CD = 'SQ'
&lt;STRONG&gt;  AND   (ACCT_STATUS_HIST.STATUS_START_DT = ACTVT_RSLT_FACT.TRN_DT)
  AND   (ACCT_STATUS_HIST.STATUS_END_DT = ACTVT_RSLT_FACT.TRN_DT)&lt;/STRONG&gt;
  AND   ACTVT_RSLT_FACT.TRN_DT BETWEEN '07JAN2017'd and '07JAN2017'd&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The account status&amp;nbsp;history table contains values for all status code history&amp;nbsp;on an account and I need it to match with SQ. I've tried placing (the bold text) after the TRN_Dt, added parenthesis, added&amp;nbsp;&amp;gt;= and &amp;lt;= (SAS stated couldn't recognize &amp;lt;&amp;gt;'s). All I want to do is give me the status code as of Jan 7, 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;output&lt;/STRONG&gt; I am getting appears to be a status code (A23)&amp;nbsp;but cannot find it on the account history.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ACCT_NUM	REQ_DT	             REQ_CD	STATUS_CD
0000000000000000 07Jan2017 0:00:00	SQ	A23&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone confirm my syntax is correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 12:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-Setting-two-variables-equal/m-p/339469#M77442</guid>
      <dc:creator>jmoore168</dc:creator>
      <dc:date>2017-03-09T12:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql = Setting two variables equal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-Setting-two-variables-equal/m-p/339658#M77519</link>
      <description>&lt;P&gt;Whether your syntax is correct depends on the underlying data, which we cannot see.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the one piece of data you show, it looks like that REQ_DT is a datetime value, not a date value. Are you sure of whether all the variables you have are date and not date time and that you're comparing them correctly?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-Setting-two-variables-equal/m-p/339658#M77519</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-09T15:09:24Z</dc:date>
    </item>
  </channel>
</rss>

