!BONTAES1.IPF - conversion from BONTEX2.IPF - to use TAESALL5.ITB as !source of name strings to be matched - takes new kcodes to taesall5 !and places 'y' tag in bonap96a for matching records !14/7/96 - have all vars changed for taesall5 BUT need to look at how !to bypass 'infra holder' records-run of 15/7/96 generated lots of no matches !that are 'no-3' typical ssps and vars - editing here to take species record !in cases where infra1=species !TABLES finish all use bonap96b with bon96bge use bonap96a with bon96ana use taesall5;default taesall5 !VARIABLES moveit=0;qrank1="";qrank2="";haverank=0;hybrid=false;qhybrid=" ";qinfra1="" qspecies="";qnameid=" ";qtaxid=" ";qtexcode=" " spelen=0;strlen=0;qinfra2="";getit=0;passit=0 texcheck=0;bypass=0 !ENVIRONMENT e.supd=true;e.deci=0;e.lnum=9 !START default taesall5 clear @6,2?"Current record - TAESALL5.ITB:" @8,2?"Current record - BONAP96A.ITB:" @10,2?"Current record - BONAP96B.ITB:" while moveit=0 do !ACTION if texcheck=0 then !STARTING RUN default taesall5 !obtain 1 - FOR USE WITH NEW RUN obtain for substr(karnam#,1,1)="n" !FOR CLEAN UP RUNS [16/7/96] texcheck=1 else !HAVE CHECK RESULTS FROM BONAP96B default taesall5 !ADD BONAP96B DATA TO taesall5 AND GET TAG FOR TRANSFER TO BONAP96A taesall5.karnam#=qnameid;taesall5.kartax#=qtaxid;qtexcode="Y" if qinfra1="to species" then taesall5.infra1=qinfra1 endif !TAG APPROPRIATE RECORD IN BONAP96A if substr(qnameid,1,1)="k" then !BY-PASS 'NO MATCH' RECORDS default bonap96a;pluck qnameid if #found=false then clear;@10,2?"Can't find ",qnameid," in BONAP96A" wait else @8,33?CURREC(BONAP96a) bonap96a.TAESLIST=qtexcode endif endif default taesall5;bypass=0 !obtain next - USE THIS FOR NEW RUN obtain next for substr(karnam#,1,1)="n" !FOR CLEAN UP RUNS [16/7/96] if rank4="infra holder" then bypass=1 else texcheck=texcheck+1;bypass=0 endif !CLEAR MATCH VARS qrank1="";qrank2="";hybrid=false;qhybrid=" ";qinfra1="";qinfra2="";qspecies="" qgenus="";spelen=0;genlen=0;getit=0;passit=0 qnameid=" ";qtaxid=" ";qtexcode=" " !CLEAR COUNTERS, LENGTHS haverank=0;strlen=0; if pastend(taesall5)=true then;moveit=1;endif !BLOCK THIS [BELOW] FOR FULL RUN !if currec(taesall5)=73 then;moveit=1;endif if moveit ne 0 then;break;endif endif if bypass=0 !ACTIONS FOR ALL RECORDS THAT ARE NOT HOLDERS !DETERMINE RANK haverank=0 !CHECK RANK4 - ALL WILL BE 'VAR.' IF RANK4 IN TAESALL5 if match(taesall5.RANK4,"var.") ne 0 then qrank1="ssp";qrank2="var";haverank=4 endif if haverank = 0 then if match(taesall5.infra1,"var.") ne 0 then qrank1="var";haverank=3 endif if match(taesall5.infra1,"ssp.") ne 0 then qrank1="ssp";haverank=3 endif endif qgenus=trim(taesall5.genus1) !CHECK FOR HYBRID - ALL ARE INTERSPECIFIC if taesall5.karstat ="hy" then hybrid=true;qhybrid="X " else hybrid=false;qhybrid=" " endif !GET SPECIES NAME if haverank lt 3 then if hybrid=true then strlen=len(trim(taesall5.species1))-2 qspecies=substr(taesall5.species1,3,strlen) else qspecies=trim(taesall5.species1) endif endif !GET SPECIES/INFRA NAME FOR RANK 3 if haverank = 3 then if qrank1="var" then !SET LENGTHS FOR SUBSTRINGS strlen=len(trim(taesall5.infra1))-4 !SUBTRACTING 'VAR. ' qinfra1=substr(taesall5.infra1,6,strlen) qspecies=trim(taesall5.species1) endif if qrank1="ssp" then !SET LENGTHS FOR SUBSTRINGS strlen=len(trim(taesall5.infra1))-4 !SUBTRACTING 'SSP. ' qinfra1=substr(taesall5.infra1,6,strlen) qspecies=trim(taesall5.species1) endif !FOR 2ND RUN [16/7] - BONAP NOT LISTING TYPICAL SSPS/VARS. SO, IF !INFRA1=SPECIES, BLANKING INFRA1 AND SETTING HAVERANK TO 2 if qinfra1=qspecies then qinfra1="to species";haverank=2 endif endif !GET SPECIES/INFRAS NAME FOR RANK 4-ALL ARE SSP. THEN VAR. if haverank = 4 then !COMBINE MOVES ABOVE TO GET STRINGS FROM INFRA1 AND RANK4 strlen=len(trim(taesall5.infra1))-4 !SUBTRACTING 'SSP. ' qinfra1=substr(taesall5.infra1,6,strlen) strlen=len(trim(taesall5.rank4))-4 !SUBTRACTING 'VAR. ' qinfra2=substr(taesall5.rank4,6,strlen) qspecies=trim(taesall5.species1) endif !HAVE SEARCH VARIABLES FROM taesall5 - NOW FIND IN BONAP96A !GENUS=qgenus-HYBRID2=qhybrid-SPECIES=qspecies-INRANK1=qrank1 !INRANK2=qrank2-INNAME1=qinfra1-INNAME2=qinfra2-RANKCODE=haverank @6,33?CURREC(taesall5) default bonap96b pluck qgenus @10,33?CURREC(BONAP96B) if #found=false then @20,2?"No match for genus: ",qgenus qnameid="no";qtaxid="genus";passit=1 endif if passit=0 then !HAVE MATCHING GENUS GET OTHER DATA default bonap96b obtain prior;getit=0 while getit=0 do @10,33?CURREC(BONAP96B) !GET RECORD FOR RANK LT 3 - NORMAL AND HYBRIDS if haverank lt 3 then obtain next if bonap96b.genus ne qgenus then !CHECK ALL WITH RELEVANT GENUS NAME getit=1 qnameid="no-2";qtaxid="species" endif if getit ne 0 then;break;endif if bonap96b.species=qspecies and bonap96b.hybrid2=qhybrid and bonap96b.rankcode=2 then qnameid=bonap96b.nameid;qtaxid=bonap96b.taxonid;getit=1 @10,33?CURREC(BONAP96B) endif endif if getit ne 0 then;break;endif !GET RECORD FOR RANK = 3 - SSP OR VAR WITH 1 INFRA NAME if haverank = 3 then obtain next if bonap96b.genus ne qgenus then !CHECK ALL WITH RELEVANT GENUS NAME getit=1 qnameid="no-3";qtaxid="species" endif if getit ne 0 then;break;endif if bonap96b.species=qspecies and bonap96b.inrank1=qrank1 and bonap96b.inname1=qinfra1 and bonap96b.rankcode=3 then qnameid=bonap96b.nameid;qtaxid=bonap96b.taxonid;getit=1 @10,33?CURREC(BONAP96B) endif endif if getit ne 0 then;break;endif !GET RECORD FOR RANK = 4 - SSP and VAR WITH 2 INFRA NAMES if haverank = 4 then obtain next if bonap96b.genus ne qgenus then !CHECK ALL WITH RELEVANT GENUS NAME getit=1 qnameid="no-4";qtaxid="species" endif if getit ne 0 then;break;endif if bonap96b.species=qspecies and bonap96b.inrank1=qrank1\ and bonap96b.inname1=qinfra1 and bonap96b.inrank2=qrank2\ and bonap96b.inname2=qinfra2 and bonap96b.rankcode=4 then qnameid=bonap96b.nameid;qtaxid=bonap96b.taxonid;getit=1 @10,33?CURREC(BONAP96B) endif endif if getit ne 0 then;break;endif endwhile !END OF GETIT LOOP endif !END OF PASSIT CLAUSE (NO GENUS) endif !END OF BYPASS CLAUSE - HOLDER EXCLUDER endwhile !OUT release moveit,qrank1,qrank2,haverank,hybrid,qhybrid,qinfra1 release qspecies,spelen,inf1len,strlen,qinfra2,texcheck release getit,passit,qnameid,qtaxid,qtexcode,genlen,qgenus,bypass finish all e.supd=false return