%( ars table day month generation %) %( rlm link 2 %) %let;rlm2;i2=%index;;t2=0%in; %( rlm link 3 %) %let;rlm3;%if;(browsing_with_sosa_ref)i3=%sosa_ref.index;;t3=sosa_1%end;%in; %( font family %) %let;ff;%if;(evar.ff != "")%evar.ff;%else;arial%end;%in; %( initial count %) %let;ic;%if;(evar.ic >= 0)%evar.ic;%else;400%end;%in; %( font size %) %let;fs;%if;(evar.fs >= 0)%evar.fs;%else;3%end;%in; %( width %) %let;width;%if;(evar.width >= 0)%evar.width;%else;2048%end;%in; %( height %) %let;height;%if;(evar.height >= 0)%evar.height;%else;1536%end;%in; %( left x %) %let;lx;%expr(width / 35)%in; %( top x %) %let;tx;%expr(height / 13)%in; %( red %) %let;red;%if;(evar.red >= 0)%evar.red;%else;10%end;%in; %( green %) %let;green;%if;(evar.green >= 0)%evar.green;%else;10%end;%in; %( blue %) %let;blue;%if;(evar.blue >= 0)%evar.blue;%else;10%end;%in; %(male birth text %) %let;mbt;%if;(evar.mbt != "")%evar.mbt;%else;%end;%in; %(male death text %) %let;mdt;%if;(evar.mdt != "")%evar.mdt;%else;%end;%in; %(female birth text %) %let;fbt;%if;(evar.fbt != "")%evar.fbt;%else;%end;%in; %(female death text %) %let;fdt;%if;(evar.fdt != "")%evar.fdt;%else;%end;%in; %(male birth field%) %let;mbf;%if;(evar.mbf != "")%evar.mbf;%else;first_name%end;%in; %(male death field%) %let;mdf;%if;(evar.mdf != "")%evar.mdf;%else;occupation%end;%in; %(female birth field%) %let;fbf;%if;(evar.fbf != "")%evar.fbf;%else;surname%end;%in; %(female death field%) %let;fdf;%if;(evar.fdf != "")%evar.fdf;%else;dates%end;%in; %define;tf1_ars(xx) %end; %define;anc_ars(m_bt,m_bf,m_dt,m_df,f_bt,f_bf,f_dt,f_df) %reset_count; %empty_sorted_list; %foreach;ancestor_level(l_v) %if;(level > 1 and (evar.only != "on" or level = l_v)) %let;lev;%expr(l_v - level + 1)%in; %foreach;ancestor; %if;(ancestor.same = "") %incr_count; %let;aad; %if;(ancestor.death_date.year > ancestor.birth_date.year) %expr((ancestor.death_date.year - ancestor.birth_date.year)*2) %else;0%nn; %end; %in; %if;(ancestor.sex = 0) %apply;add_in_sorted_list( level,ancestor.index,ancestor.sex, ancestor.birth_date.day,ancestor.birth_date.month, ancestor.death_date.day,ancestor.death_date.month, "m_bt",m_bf,"m_dt",m_df,aad,lev) %else; %apply;add_in_sorted_list( level,ancestor.index,ancestor.sex, ancestor.birth_date.day,ancestor.birth_date.month, ancestor.death_date.day,ancestor.death_date.month, "f_bt",f_bf,"f_dt",f_df,aad,lev) %end; %end; %end; %end; %end; %end; %define;des_ars(curlev,maxlev,m_bt,m_bf,m_dt,m_df,f_bt,f_bf,f_dt,f_df) %incr_count; %let;lev;%expr(l_v - curlev + 1)%in; %let;aad; %if;(death_date.year > birth_date.year) %expr((death_date.year - birth_date.year)*2) %else;0%nn; %end; %in; %if;(sex = 0) %apply;add_in_sorted_list( lev,index,sex, birth_date.day,birth_date.month, death_date.day,death_date.month, "m_bt",m_bf,"m_dt",m_df,aad,curlev) %else; %apply;add_in_sorted_list( lev,index,sex, birth_date.day,birth_date.month, death_date.day,death_date.month, "f_bt",f_bf,"f_dt",f_df,aad,curlev) %end; %foreach;family; %if;(curlev < maxlev and family.desc_level = curlev and has_children) %family.set_infinite_desc_level; %foreach;child; %apply;des_ars(curlev+1,maxlev,"m_bt","m_bf","m_dt","m_df","f_bt","f_bf","f_dt","f_df") %end; %end; %end; %end; %define;ars()
%foreach;sorted_list_item; %let;i9;%if;(count > ic)%apply;initial(item.9)%else;%item.9;%end;%in; %let;i11;%if;(count > ic)%apply;initial(item.11)%else;%item.11;%end;%in; %let;fs1;%expr((item.13 + fs) * fs)%in; %let;db;%if;(item.4 = "")%expr((item.2 + 31) % 31 + 1)%else;%item.4;%end;%in; %let;dd;%if;(item.6 = "")%expr((item.2 + 31) % 31 + 1)%else;%item.6;%end;%in; %let;mb;%if;(item.5 = "")%expr((item.2 + 12) % 12 + 1)%else;%item.5;%end;%in; %let;md;%if;(item.7 = "")%expr((item.2 + 12) % 12 + 1)%else;%item.7;%end;%in; %let;dbc;%expr(8 * db)%in; %let;ddc;%expr(8 * dd)%in; %let;mbc;%expr(21 * mb)%in; %let;mdc;%expr(21 * md)%in; %let;pad;%expr(item.13 * 10)%in; %let;aad;%expr(item.12 + green)%in; %if;(item.3 = 0) %item.8;%i9; %item.10;%i11; %end; %if;(item.3 = 1) %item.8;%i9; %item.10;%i11; %end; %end;

%hidden; %if;(evar.m = "A") %else; %end; %if;access_by_key; %if;(occ != "0") %end; %else %end;

%end; %( main %) %if;(evar.m = "A") %let;ambf;%if;(mbf != "evar.none")ancestor.%end;%mbf;%in; %let;amdf;%if;(mdf != "evar.none")ancestor.%end;%mdf;%in; %let;afbf;%if;(fbf != "evar.none")ancestor.%end;%fbf;%in; %let;afdf;%if;(fdf != "evar.none")ancestor.%end;%fdf;%in; %apply;anc_ars(mbt,ambf,mdt,amdf,fbt,afbf,fdt,afdf) %else; %apply;des_ars(0,l_v,mbt,mbf,mdt,mdf,fbt,fbf,fdt,fdf) %end; %apply;ars()