Hi, Please find the log and code below 1 The SAS System 17:11 Friday, March 29, 2019 1 ;*';*";*/;quit;run; 2 OPTIONS PAGENO=MIN; 3 %LET _CLIENTTASKLABEL='Program (2)'; 4 %LET _CLIENTPROCESSFLOWNAME='Process Flow'; 5 %LET _CLIENTPROJECTPATH=''; 6 %LET _CLIENTPROJECTNAME=''; 7 %LET _SASPROGRAMFILE=; 8 9 ODS _ALL_ CLOSE; 10 OPTIONS DEV=ACTIVEX; 11 GOPTIONS XPIXELS=0 YPIXELS=0; 12 FILENAME EGSR TEMP; 13 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR 14 STYLE=HtmlBlue 15 STYLESHEET=(URL="file:///D:/SAS/sashome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css") 16 NOGTITLE 17 NOGFOOTNOTE 18 GPATH=&sasworklocation 19 ENCODING=UTF8 20 options(rolap="on") 21 ; NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 22 23 GOPTIONS ACCESSIBLE; 24 data want(keep=person_name group_name); 25 length person_name $20 26 comp_name $20 group_name 8; 27 28 if n=1 then do; 29 declare hash h(); 30 h.definekey('comp_name'); 31 h.definedata('comp_name','group_name'); 32 h.defineDone(); 33 declare hiter hi('h'); 34 35 declare hash hh(multidata:'y'); 36 hh.definekey('group_name'); 37 h.definedata('group_name','comp_name'); 38 hh.defineDone(); 39 40 _group_name=0; 41 end; 42 43 set have; 44 45 rc=h.find(key:person_name); 46 47 if rc ne 0 then do; 48 rc=hi.first(); 49 do while(rc=0); 50 51 if complev(person_name,comp_name)le 2 then do; 52 rc=hh.find(); 53 54 do while(r ne 0); 55 dist=complev(person_name,comp_name); 56 hh.has_next(result:r); 57 2 The SAS System 17:11 Friday, March 29, 2019 58 if r=0 & dist le 2 then do; 59 h.add(key:person_name, data:person_name, data:group_name); 60 hh.add(); 61 output; 62 return; 63 end; 64 65 else if r ne 0 & dist le 2 then 66 rc=hh.find_next(); 67 68 else if dist>2 then leave; 69 70 end; 71 72 end; 73 74 rc=hi.next(); 75 76 end; 77 78 _group_name+1; 79 group_name=_group_name; 80 h.add(key:person_name, data:person_name, data:group_name); 81 hh.add(key:group_name, data:group_name, data:person_name); 82 end; 83 84 output; 85 run; NOTE: Variable comp_name is uninitialized. NOTE: Variable n is uninitialized. ERROR: Uninitialized object at line 45 column 4. ERROR: DATA STEP Component Object failure. Aborted during the EXECUTION phase. NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 1 observations read from the data set WORK.HAVE. WARNING: The data set WORK.WANT may be incomplete. When this step was stopped there were 0 observations and 2 variables. WARNING: Data set WORK.WANT was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.02 seconds 86 87 GOPTIONS NOACCESSIBLE; 88 %LET _CLIENTTASKLABEL=; 89 %LET _CLIENTPROCESSFLOWNAME=; 90 %LET _CLIENTPROJECTPATH=; 91 %LET _CLIENTPROJECTNAME=; 92 %LET _SASPROGRAMFILE=; 93 94 ;*';*";*/;quit;run; 95 ODS _ALL_ CLOSE; 96 97 98 QUIT; RUN; 99 ------------------------------------------------------ ------------------------------------------------------ data have; input person_name:$20.; datalines; michael michel kurt kirt michaell benjamin mich ; run; data want(keep=person_name group_name); length person_name $20 comp_name $20 group_name 8; if n=1 then do; declare hash h(); h.definekey('comp_name'); h.definedata('comp_name','group_name'); h.defineDone(); declare hiter hi('h'); declare hash hh(multidata:'y'); hh.definekey('group_name'); h.definedata('group_name','comp_name'); hh.defineDone(); _group_name=0; end; set have; rc=h.find(key:person_name); if rc ne 0 then do; rc=hi.first(); do while(rc=0); if complev(person_name,comp_name)le 2 then do; rc=hh.find(); do while(r ne 0); dist=complev(person_name,comp_name); hh.has_next(result:r); if r=0 & dist le 2 then do; h.add(key:person_name, data:person_name, data:group_name); hh.add(); output; return; end; else if r ne 0 & dist le 2 then rc=hh.find_next(); else if dist>2 then leave; end; end; rc=hi.next(); end; _group_name+1; group_name=_group_name; h.add(key:person_name, data:person_name, data:group_name); hh.add(key:group_name, data:group_name, data:person_name); end; output; run;
... View more