<?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: Matching is not Working Properly in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541230#M7175</link>
    <description>&lt;P&gt;Thank you in advance for your help Kurt!&amp;nbsp; Here you go:&lt;/P&gt;&lt;P&gt;/* begin matching process&amp;nbsp; */&lt;BR /&gt;&lt;BR /&gt;data def.grp1 def.grp2;&lt;BR /&gt;set def.combined_finalab;&lt;BR /&gt;array x[4] var11 Financial_Fraud__Irregularities&lt;BR /&gt;Errors___Accounting_and_Clerical Other_Significant_Issues;&lt;BR /&gt;obs=_n_;&lt;BR /&gt;listCount1=0;&lt;BR /&gt;listCount2=0;&lt;BR /&gt;listCount3=0;&lt;BR /&gt;listCount4=0;&lt;BR /&gt;do i = 1 to 4;&lt;BR /&gt;&amp;nbsp; if input(scan(var11,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount1=sum(listCount1,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Financial_Fraud__Irregularities,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount2=sum(listCount2,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Errors___Accounting_and_Clerical,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount3=sum(listCount3,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Other_Significant_Issues,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount4=sum(listCount4,1);&lt;BR /&gt;end;&lt;BR /&gt;listcount=sum(listcount1,listcount2,listcount3,listcount4);&lt;BR /&gt;if littler=0 then output def.grp1;&lt;BR /&gt;else output def.grp2;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;/* Expand to 1 record per item in the list */&lt;BR /&gt;&lt;BR /&gt;data def.grp1Tall;&lt;BR /&gt;set def.grp1;&lt;BR /&gt;do i = 1 to listCount1;&lt;BR /&gt;&amp;nbsp; value=100+input(scan(var11,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount2;&lt;BR /&gt;&amp;nbsp; value=200+input(scan(Financial_Fraud__Irregularities,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount3;&lt;BR /&gt;&amp;nbsp; value=300+input(scan(Errors___Accounting_and_Clerical,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount4;&lt;BR /&gt;&amp;nbsp; value=400+input(scan(Other_Significant_Issues,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;data def.grp2Tall;&lt;BR /&gt;set def.grp2;&lt;BR /&gt;do i = 1 to listCount1;&lt;BR /&gt;&amp;nbsp; value=100+input(scan(var11,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount2;&lt;BR /&gt;&amp;nbsp; value=200+input(scan(Financial_Fraud__Irregularities,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount3;&lt;BR /&gt;&amp;nbsp; value=300+input(scan(Errors___Accounting_and_Clerical,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount4;&lt;BR /&gt;&amp;nbsp; value=400+input(scan(Other_Significant_Issues,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/* For each observation in grp1, find the number matching&lt;BR /&gt;&amp;nbsp;&amp;nbsp; in grp2.&amp;nbsp; Only keep the records where the number of matches equals&lt;BR /&gt;&amp;nbsp;&amp;nbsp; the number in the grp1 list&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table def.temp as&lt;BR /&gt;select a.listCount, a.obs, b.obs as obs2, count(*) as matchCount&lt;BR /&gt;from def.grp1Tall as a, def.grp2Tall as b&lt;BR /&gt;where a.value = b.value&lt;BR /&gt;and a.listCount LE b.listCount&lt;BR /&gt;group by 1,2,3&lt;BR /&gt;having listCount = matchCount;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;/* Finally, join the two */&lt;BR /&gt;proc sql;&lt;BR /&gt;create table def.final as&lt;BR /&gt;select a.*, b.obs2, c.cik_code as cik_code2, c.var11 as var112, c. Financial_Fraud__Irregularities as Financial_Fraud__Irregularities2, c. Errors___Accounting_and_Clerical as E2, c. Other_Significant_Issues as Other_Significant_Issues2, c.lnassets as lnassets2, c.roa as roa2,&lt;BR /&gt;c.size as size2, c.mtb as mtb2, c.lev as lev2, c.fcf as fcf2, c.loss as loss2, c.foreign as foreign2, c.segment as segment2, c.abnbhar as abnbhar2, c.big4 as big42, c.city_expertise3 as city_expertise32, c.national_expertise3 as national_expertise32, c.icweakness as icweakness2, c.clientimp as clientimp2, c.contten as contten2, c.notbusy as notbusy2, c.littler as littler2, c.multiplerestatements as multiplerestatements2, c.sic as sic2, c.lnccse as lnccse2, c.effectx as effectx2, c.fyear as fyear2&lt;BR /&gt;from def.grp1 a, def.temp b, def.grp2 c&lt;BR /&gt;where a.obs=b.obs&lt;BR /&gt;&amp;nbsp; and c.obs=b.obs2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data def.final2;&lt;BR /&gt;set def.final;&lt;BR /&gt;if roa=. then delete;&lt;BR /&gt;if roa2=. then delete;&lt;BR /&gt;if lnassets=. then delete;&lt;BR /&gt;if lnassets2=. then delete;&lt;BR /&gt;distance=lnassets2-lnassets;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.final2;&lt;BR /&gt;by obs distance;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final3;&lt;BR /&gt;set def.final2;&lt;BR /&gt;by obs distance;&lt;BR /&gt;if first.obs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final4;&lt;BR /&gt;set def.final3;&lt;BR /&gt;distance2=roa2-roa;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.final4;&lt;BR /&gt;by obs distance2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final5;&lt;BR /&gt;set def.final4;&lt;BR /&gt;by obs distance2;&lt;BR /&gt;if first.obs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc means data=def.final5;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.bigr def.littler;&lt;BR /&gt;set def.final5;&lt;BR /&gt;if littler=0 then output def.bigr;&lt;BR /&gt;if littler2=1 then output def.littler;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;data def.bigr1;&lt;BR /&gt;set def.bigr;&lt;BR /&gt;keep cik_code fyear sic size mtb lev fcf roa loss foreign segment abnbhar big4 city_expertise3 national_expertise3 icweakness clientimp contten notbusy lnccse effectx var11 Financial_Fraud__Irregularities Errors___Accounting_and_Clerical Other_Significant_Issues littler multiplerestatements lnassets;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.littler1;&lt;BR /&gt;set def.littler;&lt;BR /&gt;keep cik_code2 fyear2 sic2 size2 mtb2 lev2 fcf2 roa2 loss2 foreign2 segment2 abnbhar2 big42 city_expertise32 national_expertise32 icweakness2 clientimp2 contten2 notbusy2 lnccse2 effectx2 var112 Financial_Fraud__Irregularities2 E2 Other_Significant_Issues2 littler2 multiplerestatements2 lnassets2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.littler2;&lt;BR /&gt;set def.littler1;&lt;BR /&gt;rename cik_code2=cik_code;&lt;BR /&gt;rename fyear2=fyear;&lt;BR /&gt;rename sic2=sic;&lt;BR /&gt;rename size2=size;&lt;BR /&gt;rename mtb2=mtb;&lt;BR /&gt;rename lev2=lev;&lt;BR /&gt;rename fcf2=fcf;&lt;BR /&gt;rename roa2=roa;&lt;BR /&gt;rename loss2=loss;&lt;BR /&gt;rename foreign2=foreign;&lt;BR /&gt;rename segment2=segment;&lt;BR /&gt;rename abnbhar2=abnbhar;&lt;BR /&gt;rename big42=big4;&lt;BR /&gt;rename city_expertise32=city_expertise3;&lt;BR /&gt;rename national_expertise32=national_expertise3;&lt;BR /&gt;rename icweakness2=icweakness;&lt;BR /&gt;rename clientimp2=clientimp;&lt;BR /&gt;rename contten2=contten;&lt;BR /&gt;rename notbusy2=notbusy;&lt;BR /&gt;rename lnccse2=lnccse;&lt;BR /&gt;rename effectx2=effectx;&lt;BR /&gt;rename littler2=littler;&lt;BR /&gt;rename multiplerestatements2=multiplerestatements;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.bigr1 out=def.bigr2; by cik_code fyear;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.littler2 out=def.littler3; by cik_code fyear;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.combinedfinal;&lt;BR /&gt;set def.bigr2 def.littler3;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.combinedfinal1;&lt;BR /&gt;set def.combinedfinal;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc means data=def.combinedfinal1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;title "Matching Results without SIC";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc logistic data= def.combinedfinal1;&lt;BR /&gt;&amp;nbsp; class fyear SIC;&lt;BR /&gt;&amp;nbsp; class Loss / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Foreign / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Big4 / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class City_Expertise3 / param=ref ref=first;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; class Natio6nal_Expertise3 / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class ICWeakness / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Notbusy / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class MultipleRestatements / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; model LittleR(event="1") = contten clientimp multiplerestatements&lt;BR /&gt;&amp;nbsp; lnccse city_expertise3 national_expertise3 big4 size mtb segment&lt;BR /&gt;&amp;nbsp; foreign lev fcf roa abnbhar icweakness notbusy loss fyear sic&lt;BR /&gt;&amp;nbsp;/ link=probit RSQ;&lt;BR /&gt;output out= Def.combinedfinal1_prob3 p=Probability;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2019 21:27:24 GMT</pubDate>
    <dc:creator>jjadalla</dc:creator>
    <dc:date>2019-03-07T21:27:24Z</dc:date>
    <item>
      <title>Matching is not Working Properly</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541221#M7172</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;For some reason, my matching code is not giving me what I want.&amp;nbsp; I attached my code and the SAS dataset to start with.&amp;nbsp; Here's what I want.&amp;nbsp; I want to match with replacement where there are unique observations of littler=0.&amp;nbsp; If 1 observation of littler=0 matches with an observation of littler=1, it is OK for a different observation of littler=0 to match with the same observation of littler=1.&amp;nbsp; However, each littler=0 in the match needs to be unique.&amp;nbsp; I am not getting that.&amp;nbsp; Please let me know what I'm doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;God bless, best regards, and take care,&lt;/P&gt;&lt;P&gt;Jadallah&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 20:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541221#M7172</guid>
      <dc:creator>jjadalla</dc:creator>
      <dc:date>2019-03-07T20:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Matching is not Working Properly</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541223#M7173</link>
      <description>&lt;P&gt;Post datasets as data steps with datalines; post all SAS codes using the "little running man".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no need for zip archives or MS Office files.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 21:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541223#M7173</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-07T21:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Matching is not Working Properly</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541230#M7175</link>
      <description>&lt;P&gt;Thank you in advance for your help Kurt!&amp;nbsp; Here you go:&lt;/P&gt;&lt;P&gt;/* begin matching process&amp;nbsp; */&lt;BR /&gt;&lt;BR /&gt;data def.grp1 def.grp2;&lt;BR /&gt;set def.combined_finalab;&lt;BR /&gt;array x[4] var11 Financial_Fraud__Irregularities&lt;BR /&gt;Errors___Accounting_and_Clerical Other_Significant_Issues;&lt;BR /&gt;obs=_n_;&lt;BR /&gt;listCount1=0;&lt;BR /&gt;listCount2=0;&lt;BR /&gt;listCount3=0;&lt;BR /&gt;listCount4=0;&lt;BR /&gt;do i = 1 to 4;&lt;BR /&gt;&amp;nbsp; if input(scan(var11,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount1=sum(listCount1,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Financial_Fraud__Irregularities,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount2=sum(listCount2,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Errors___Accounting_and_Clerical,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount3=sum(listCount3,1);&lt;BR /&gt;&amp;nbsp; if input(scan(Other_Significant_Issues,i,','),4.) GT .z then&lt;BR /&gt;&amp;nbsp; listCount4=sum(listCount4,1);&lt;BR /&gt;end;&lt;BR /&gt;listcount=sum(listcount1,listcount2,listcount3,listcount4);&lt;BR /&gt;if littler=0 then output def.grp1;&lt;BR /&gt;else output def.grp2;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;/* Expand to 1 record per item in the list */&lt;BR /&gt;&lt;BR /&gt;data def.grp1Tall;&lt;BR /&gt;set def.grp1;&lt;BR /&gt;do i = 1 to listCount1;&lt;BR /&gt;&amp;nbsp; value=100+input(scan(var11,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount2;&lt;BR /&gt;&amp;nbsp; value=200+input(scan(Financial_Fraud__Irregularities,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount3;&lt;BR /&gt;&amp;nbsp; value=300+input(scan(Errors___Accounting_and_Clerical,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount4;&lt;BR /&gt;&amp;nbsp; value=400+input(scan(Other_Significant_Issues,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;data def.grp2Tall;&lt;BR /&gt;set def.grp2;&lt;BR /&gt;do i = 1 to listCount1;&lt;BR /&gt;&amp;nbsp; value=100+input(scan(var11,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount2;&lt;BR /&gt;&amp;nbsp; value=200+input(scan(Financial_Fraud__Irregularities,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount3;&lt;BR /&gt;&amp;nbsp; value=300+input(scan(Errors___Accounting_and_Clerical,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;do i = 1 to listCount4;&lt;BR /&gt;&amp;nbsp; value=400+input(scan(Other_Significant_Issues,i,','),4.);&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/* For each observation in grp1, find the number matching&lt;BR /&gt;&amp;nbsp;&amp;nbsp; in grp2.&amp;nbsp; Only keep the records where the number of matches equals&lt;BR /&gt;&amp;nbsp;&amp;nbsp; the number in the grp1 list&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table def.temp as&lt;BR /&gt;select a.listCount, a.obs, b.obs as obs2, count(*) as matchCount&lt;BR /&gt;from def.grp1Tall as a, def.grp2Tall as b&lt;BR /&gt;where a.value = b.value&lt;BR /&gt;and a.listCount LE b.listCount&lt;BR /&gt;group by 1,2,3&lt;BR /&gt;having listCount = matchCount;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;/* Finally, join the two */&lt;BR /&gt;proc sql;&lt;BR /&gt;create table def.final as&lt;BR /&gt;select a.*, b.obs2, c.cik_code as cik_code2, c.var11 as var112, c. Financial_Fraud__Irregularities as Financial_Fraud__Irregularities2, c. Errors___Accounting_and_Clerical as E2, c. Other_Significant_Issues as Other_Significant_Issues2, c.lnassets as lnassets2, c.roa as roa2,&lt;BR /&gt;c.size as size2, c.mtb as mtb2, c.lev as lev2, c.fcf as fcf2, c.loss as loss2, c.foreign as foreign2, c.segment as segment2, c.abnbhar as abnbhar2, c.big4 as big42, c.city_expertise3 as city_expertise32, c.national_expertise3 as national_expertise32, c.icweakness as icweakness2, c.clientimp as clientimp2, c.contten as contten2, c.notbusy as notbusy2, c.littler as littler2, c.multiplerestatements as multiplerestatements2, c.sic as sic2, c.lnccse as lnccse2, c.effectx as effectx2, c.fyear as fyear2&lt;BR /&gt;from def.grp1 a, def.temp b, def.grp2 c&lt;BR /&gt;where a.obs=b.obs&lt;BR /&gt;&amp;nbsp; and c.obs=b.obs2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;data def.final2;&lt;BR /&gt;set def.final;&lt;BR /&gt;if roa=. then delete;&lt;BR /&gt;if roa2=. then delete;&lt;BR /&gt;if lnassets=. then delete;&lt;BR /&gt;if lnassets2=. then delete;&lt;BR /&gt;distance=lnassets2-lnassets;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.final2;&lt;BR /&gt;by obs distance;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final3;&lt;BR /&gt;set def.final2;&lt;BR /&gt;by obs distance;&lt;BR /&gt;if first.obs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final4;&lt;BR /&gt;set def.final3;&lt;BR /&gt;distance2=roa2-roa;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.final4;&lt;BR /&gt;by obs distance2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.final5;&lt;BR /&gt;set def.final4;&lt;BR /&gt;by obs distance2;&lt;BR /&gt;if first.obs;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc means data=def.final5;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.bigr def.littler;&lt;BR /&gt;set def.final5;&lt;BR /&gt;if littler=0 then output def.bigr;&lt;BR /&gt;if littler2=1 then output def.littler;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;data def.bigr1;&lt;BR /&gt;set def.bigr;&lt;BR /&gt;keep cik_code fyear sic size mtb lev fcf roa loss foreign segment abnbhar big4 city_expertise3 national_expertise3 icweakness clientimp contten notbusy lnccse effectx var11 Financial_Fraud__Irregularities Errors___Accounting_and_Clerical Other_Significant_Issues littler multiplerestatements lnassets;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.littler1;&lt;BR /&gt;set def.littler;&lt;BR /&gt;keep cik_code2 fyear2 sic2 size2 mtb2 lev2 fcf2 roa2 loss2 foreign2 segment2 abnbhar2 big42 city_expertise32 national_expertise32 icweakness2 clientimp2 contten2 notbusy2 lnccse2 effectx2 var112 Financial_Fraud__Irregularities2 E2 Other_Significant_Issues2 littler2 multiplerestatements2 lnassets2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.littler2;&lt;BR /&gt;set def.littler1;&lt;BR /&gt;rename cik_code2=cik_code;&lt;BR /&gt;rename fyear2=fyear;&lt;BR /&gt;rename sic2=sic;&lt;BR /&gt;rename size2=size;&lt;BR /&gt;rename mtb2=mtb;&lt;BR /&gt;rename lev2=lev;&lt;BR /&gt;rename fcf2=fcf;&lt;BR /&gt;rename roa2=roa;&lt;BR /&gt;rename loss2=loss;&lt;BR /&gt;rename foreign2=foreign;&lt;BR /&gt;rename segment2=segment;&lt;BR /&gt;rename abnbhar2=abnbhar;&lt;BR /&gt;rename big42=big4;&lt;BR /&gt;rename city_expertise32=city_expertise3;&lt;BR /&gt;rename national_expertise32=national_expertise3;&lt;BR /&gt;rename icweakness2=icweakness;&lt;BR /&gt;rename clientimp2=clientimp;&lt;BR /&gt;rename contten2=contten;&lt;BR /&gt;rename notbusy2=notbusy;&lt;BR /&gt;rename lnccse2=lnccse;&lt;BR /&gt;rename effectx2=effectx;&lt;BR /&gt;rename littler2=littler;&lt;BR /&gt;rename multiplerestatements2=multiplerestatements;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.bigr1 out=def.bigr2; by cik_code fyear;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=def.littler2 out=def.littler3; by cik_code fyear;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.combinedfinal;&lt;BR /&gt;set def.bigr2 def.littler3;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data def.combinedfinal1;&lt;BR /&gt;set def.combinedfinal;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc means data=def.combinedfinal1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;title "Matching Results without SIC";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc logistic data= def.combinedfinal1;&lt;BR /&gt;&amp;nbsp; class fyear SIC;&lt;BR /&gt;&amp;nbsp; class Loss / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Foreign / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Big4 / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class City_Expertise3 / param=ref ref=first;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; class Natio6nal_Expertise3 / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class ICWeakness / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class Notbusy / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; class MultipleRestatements / param=ref ref=first;&lt;BR /&gt;&amp;nbsp; model LittleR(event="1") = contten clientimp multiplerestatements&lt;BR /&gt;&amp;nbsp; lnccse city_expertise3 national_expertise3 big4 size mtb segment&lt;BR /&gt;&amp;nbsp; foreign lev fcf roa abnbhar icweakness notbusy loss fyear sic&lt;BR /&gt;&amp;nbsp;/ link=probit RSQ;&lt;BR /&gt;output out= Def.combinedfinal1_prob3 p=Probability;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 21:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Matching-is-not-Working-Properly/m-p/541230#M7175</guid>
      <dc:creator>jjadalla</dc:creator>
      <dc:date>2019-03-07T21:27:24Z</dc:date>
    </item>
  </channel>
</rss>

