<?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: SAS Code Help in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554609#M9535</link>
    <description>What's the question/problem?</description>
    <pubDate>Sun, 28 Apr 2019 18:03:00 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-04-28T18:03:00Z</dc:date>
    <item>
      <title>SAS Code Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554603#M9534</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;How should we Modify the Code ?

Proc sql;
create table SROin_2 as
		select
			/* Before = Faults */
			before.urn,
			before.Close_Date,
			before.Close_Date			as	dayt,
			before.dayt 				as fault_checked_date, /** 07/12/2010 - JW - Added this date in to statement **/
			before.TECH_no1,
			before.WORKORDER,
			before.finding_desc,
			before.solution_desc,
			before.source_system_code,
			before.franchise_Code,
			before.account_no,
			before.trucked_fault,
			/* After = SROs */
			/* PR-added COMPLETIONDATE (P0002373164)*/
			after.ENTRYDATE,
			after.ENTRYDATE				as	dayt,
			after.COMPLETIONDATE,
			after.workorder				as SRO_WO,
			after.SERVICE_CODE,
			after.TECH_NO1				as A_Tech_No1
		from Closed_Faults as before left join
			 SROs as after
		on  before.urn = after.urn
			and before.dayt le after.dayt
			and after.dayt lt (before.dayt + 1 + 1)
			and after.urn ne ""
		order by before.dayt, urn;
quit;

Modified Code

Proc SQL;
Create table SROin_2 as
Select
        /* Before = Faults */
Coalesce(before.closeddate,open.schedule_date) as faultdate,
                  before.urn,
                  before.Close_Date,
                  before.Close_Date as    dayt,
                  before.dayt             as fault_checked_date, /** 07/12/2010 - JW - Added this date in to statement **/
                  before.TECH_no1,
                  before.WORKORDER,
                  before.finding_desc,
                  before.solution_desc,
                  before.source_system_code,
                  before.franchise_Code,
                  before.account_no,
                  before.trucked_fault,
                  /* After = SROs */
                  /* PR-added COMPLETIONDATE (P0002373164)*/
                  after.ENTRYDATE,
                  after.ENTRYDATE                     as    dayt,
                  after.COMPLETIONDATE,
                  after.workorder                     as SRO_WO,
                  after.SERVICE_CODE,
                  after.TECH_NO1                      as A_Tech_No1
from SROs as SRO 
left join 
Closed_Faults as before on sro.urn=before.urn 
and SRO.Opendate lt (before.dayt+1)
left join
Open as Open ON SRO.URN = OPEN.URN
and SRO.Opendate lt (OPEN.SCHEDULE_DATE+1)
where Before.URN IS NOT NULL OR OPEN.URN IS NOT NULL
order by before.dayt,urn;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Apr 2019 16:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554603#M9534</guid>
      <dc:creator>saikiran_nemani</dc:creator>
      <dc:date>2019-04-28T16:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554609#M9535</link>
      <description>What's the question/problem?</description>
      <pubDate>Sun, 28 Apr 2019 18:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554609#M9535</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-04-28T18:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554614#M9536</link>
      <description>&lt;P&gt;pick one unique identifier and put that into where clause&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then compare the output to your desired output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;community is to give ideas or direct in a path that leads to solution. not write the code for you&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 18:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Code-Help/m-p/554614#M9536</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-04-28T18:42:19Z</dc:date>
    </item>
  </channel>
</rss>

