| 1 |
/* |
| 2 |
* @progname afn_match.ll |
| 3 |
* @version 1.0 of 1995-08-25 |
| 4 |
* @author Scott McGee |
| 5 |
* @category |
| 6 |
* @output Text |
| 7 |
* @description |
| 8 |
* |
| 9 |
* Find individuals with matching Ancestral File numbers, report matches. |
| 10 |
* |
| 11 |
|
| 12 |
This program is designed to search a database and find individuals with |
| 13 |
the same AFN's. The output is a report of such matching individuals. |
| 14 |
|
| 15 |
Last updated 25 Aug, 1995 by Scott McGee ([email protected]) |
| 16 |
*/ |
| 17 |
|
| 18 |
global(first) |
| 19 |
|
| 20 |
proc main (){ |
| 21 |
table(t) |
| 22 |
|
| 23 |
set(first, 1) |
| 24 |
print("Processing database ") |
| 25 |
set(cnt, 0) |
| 26 |
forindi(indi, n){ |
| 27 |
if(afn, get_afn(indi)){ |
| 28 |
if(match, lookup(t, afn)){ |
| 29 |
call found_match(indi, save(afn), match) |
| 30 |
}else{ |
| 31 |
insert(t, save(afn), indi) |
| 32 |
} |
| 33 |
} |
| 34 |
incr(cnt) |
| 35 |
if(eq(cnt, 100)){ |
| 36 |
set(cnt, 0) |
| 37 |
print(".") |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
func get_afn(indi){ |
| 43 |
if(indi){ |
| 44 |
fornodes(inode(indi), subnode){ |
| 45 |
if(eqstr(tag(subnode), "AFN")){ |
| 46 |
return(value(subnode)) |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
return(0) |
| 51 |
} |
| 52 |
|
| 53 |
proc found_match(i2, afn, i1){ |
| 54 |
if(first){ |
| 55 |
set(first, 0) |
| 56 |
"Ancestral File Number match report\n\n" |
| 57 |
"produced by afn_match.ll version 1.0\n" |
| 58 |
"by Scott McGee ([email protected])\n\n" |
| 59 |
"Database: " |
| 60 |
database() |
| 61 |
"\nDate: " |
| 62 |
long(gettoday()) |
| 63 |
"\n\n" |
| 64 |
"AFN Key1 Key2 Name1\n" |
| 65 |
"_________________________________________________________________________\n" |
| 66 |
} |
| 67 |
afn |
| 68 |
col(10) |
| 69 |
key(i1) |
| 70 |
col(20) |
| 71 |
key(i2) |
| 72 |
col(30) |
| 73 |
name(i1, 0) |
| 74 |
"\n" |
| 75 |
} |