/*-------------------------------------------------------------------------- /* Washington State Department Of Natural Resources /* Information Technology Division /*-------------------------------------------------------------------------- /* Program: CADASTRE_DTS_INFO.AML (Cadastre Data Transfer Standard Info) /* Purpose: Creates cadastral data transfer standard info table within the /* current info directory. The programs argument is the type of /* table to build. If the table already exists, the user is /* prompted to see if they would like to delete the current one /* then generate new table. For the ALL option, all tables will /* be deleted. The program error checks for if the program is /* ran from arc, if there is an info directory to write to, if /* a correct argument was entered. /* /*-------------------------------------------------------------------------- /* Usage: CADASTRE_DTS_INFO.AML /* /* Arguments: dts$tabtype - Which table to build, boundary for example /* - The different types are: /* BDRYTY - Boundary Type /* BDRYPT - Boundary - Point /* CNRCLQUAL - Corner Class Qualifier /* DOC - Document /* LAD - Legal Area Description /* LADBDRY - Legal Area Description - Boundary /* LADPT - Legal Area Description - Point /* POINT - Point /* LANDPRCL - Land Parcel /* PRCLAGNTDOC - Parcel Agent Document /* PRCLTYPE - Parcel Type /* PRCLRT - Parcel Right /* PRCLLAD - Parcel - Legal Area Description /* TRAN - Transaction /* ALL - All Tables /* /* /* Routines: INIT - Initialize program variables. /* ERRORTRAP - Trap possible errors befor application procedes. /* USAGE - Return program usage. /* EXIT - Clean up and exit program /* BAILOUT - AML program error handling /* GENTABLE - Prompts user to generate table. If table exists /* checks to see if user wants to delete it first. /* GENALLTABLES - Prompts user to generate all tables. Prompts /* user if wants to delete all tables first. /* If user does not delete then no tables are /* generated. /* MAKEBDRY - defines the boundary info table. /* MAKEBDRYTY - defines the boundary type info table. /* MAKEBDRYPT - defines the boundary point relationship info table. /* MAKECNRCLQUAL - defines the corner class qualifier info table. /* MAKEDOC - defines the document info table. /* MAKELANDPRCL - defines the land parcel info table. /* MAKEPRCLTYPE - defines the land parcel type info table. /* MAKEPRCLRT - defines the land parcel right info table. /* MAKEPRCLAGNTDOC - defines the parcel agent document info table. /* MAKEPRCLLAD - defines the parcel to legal area description /* relationship info table. /* MAKELAD - defines the legal area description info table. /* MAKELADBDRY - defines the legal area description to boundary /* relationship info table. /* MAKELADPT - defines the legal area description to point /* relationship info table. /* MAKEPOINT - defines the point info table. /* MAKETRAN - defines the transaction info table. /* /* Globals: /* /*-------------------------------------------------------------------------- /* Called By: none /*-------------------------------------------------------------------------- /* Calls: none /*-------------------------------------------------------------------------- /* Notes: /*-------------------------------------------------------------------------- /* History: Kevin Kozak 04/18/2000 - Original Coding /*========================================================================== /* &args dts$tabtype &severity &error &routine bailout /* Check to see if a routine argument entered &if not [null %dts$tabtype%] &then &do &call INIT /* call init routine /* select what table to generate and build it /* Start tables tables &select [upcase %dts$tabtype%] /* select table type to build &when BDRY /* boundary &do &s dts$routinenm = MAKEBDRY &call GENTABLE /* call routine generate table &end /* when bdry &when BDRYTY /* boundary type &do &s dts$routinenm = MAKEBDRYTY &call GENTABLE /* call routine generate table &end /* when bdryty &when BDRYPT /* boundary point relationship &do &s dts$routinenm = MAKEBDRYPT &call GENTABLE /* call routine generate table &end /* when bdryty &when CNRCLQUAL /* corner class qualifier type &do &s dts$routinenm = MAKECNRCLQUAL &call GENTABLE /* call routine generate table &end /* when cnrclqual &when DOC /* document &do &s dts$routinenm = MAKEDOC &call GENTABLE /* call routine generate table &end /* when doc &when PRCLAGNTDOC /* parcel agent document &do &s dts$routinenm = MAKEPRCLAGNTDOC &call GENTABLE /* call routine generate table &end /* when prclagntdoc &when LANDPRCL /* land parcel &do &s dts$routinenm = MAKELANDPARCEL &call GENTABLE /* call routine generate table &end /* when landprcl &when PRCLTYPE /* parcel type &do &s dts$routinenm = MAKEPRCLTYPE &call GENTABLE /* call routine generate table &end /* when prcltype &when PRCLRT /* parcel right &do &s dts$routinenm = MAKEPRCLRIGHT &call GENTABLE /* call routine generate table &end /* when prclrt &when PRCLLAD /* parcel to legal area description relationship &do &s dts$routinenm = MAKEPRCLLAD &call GENTABLE /* call routine generate table &end /* when prcllad &when LAD /* legal area description &do &s dts$routinenm = MAKELAD &call GENTABLE /* call routine generate table &end /* when lad &when LADBDRY /* legal area description to boundary relateionship &do &s dts$routinenm = MAKELADBDRY &call GENTABLE /* call routine generate table &end /* when ladbdry &when LADPT /* legal area description to point relateionship &do &s dts$routinenm = MAKELADPT &call GENTABLE /* call routine generate table &end /* when ladpt &when POINT /* point &do &s dts$routinenm = MAKEPOINT &call GENTABLE /* call routine generate table &end /* when point &when TRAN /* transaction &do &s dts$routinenm = MAKETRAN &call GENTABLE /* call routine generate table &end /* when tran &when ALL /* generate all tables &do &call GENALLTABLES /* call routine generate all tables &end /* when all &end /* select table type /* quit tables quit &call EXIT /* call the exit routine &end /* if not null routine &else &do &call usage /* no routine entered, call usage routine &end /* else not null routine &return /* end program bdry_dts_info.aml /***** /***** program routines are below /***** /*----------- &routine INIT /*----------- /* Initialize program variables, call routine errortrap and if any errors then call exit /* routine else proceed with error checks. Sets directory paths program. /* inform user initializing program &type Initializing Cadastral DTS INFO Program... &s routinename = INIT /* set routine error name /* initialize variables &s dts$continue = .true. /* flag if any errors found in errortrap, false = yes and true = no &s dts$errortype /* type of error found in error trap &s dts$tabnm = dts%dts$tabtype% /* name of info table &s dts$difftabs = BDRY BDRYTY BDRYPT CNRCLQUAL DOC LAD LADBDRY LADPT POINT LANDPRCL PRCLAGNTDOC PRCLTYPE PRCLRT PRCLLAD TRAN /* list of different table options /* trap for errors in usage of program by calling errortrap routine &call errortrap /* call error trap routine &return /* end routine INIT /*---------------- &routine ERRORTRAP /*---------------- /* Trap possible errors to program for If program called from ARC. If /* any errors then continue variable set to false and program will exit, else continue /* is set to true so that program will continue. Called from INIT routine. Calls routines /* USAGE and EXIT. &s routinename = ERRORTRAP /* set routine error name /* check for program called from Arc &if [show program] ne ARC &then &do &s dts$errortype = notarc /* set error type to not in arc &s dts$continue = .false. /* set continue flag to false so end program &end /* if show program ne arc /* check to see if an info directory exist &if %dts$continue% and not [exist info -directory] &then &do &s dts$errortype = noinfo /* set error type wrong type of table &s dts$continue = .false. /* set continue flag to false so end program &end /* if info exist /* check to see if table type args ok &if %dts$continue% and [keyword [upcase %dts$tabtype%] %dts$difftabs% ALL] < 1 &then &do &s dts$errortype = tabtype /* set error type wrong type of table &s dts$continue = .false. /* set continue flag to false so end program &end /* if table types /* Check continue variable to see if any errors found, /* if any errors print out error message and call exit routine /* if not continue, (continue = false) &if not %dts$continue% &then &do /* inform user of error type &select %dts$errortype% &when notarc &do &type An Error has accured in program CADASTRE_DTS_INFO.AML, &type Program CADASTRE_DTS_INFO.AML not ran from Arc... &end /* when notarc &when noinfo &do &type An Error has accured in program CADASTRE_DTS_INFO.AML, &type Current directory is not an Arc Workspace... &end /* when notarc &when tabtype &do &type An Error has accured in program CADASTRE_DTS_INFO.AML, &type Wrong type of table to generate entered... &end /* when tabtype &otherwise &do &type Unknow type of Error has occured in Program CADASTRE_DTS_INFO.AML ... &end /* otherwise &end /* select errortype /* call usage routine &call usage /* call exit routine &call exit &end /* if not continue &return /* end routine ERRORTRAP /*--------------- &routine GENTABLE /*--------------- /* prompts user to generate table. If table exists checks to see if /* user wants to delete it first. /* if table exist check to see if delete it &if [exists %dts$tabnm% -info] &then &do &type [quote Table %dts$tabnm% exist...] &if [query 'Do you want to delete table and generate new one' .true.] &then &do &type [quote Deleting table %dts$tabnm%...] &s bunk = [delete %dts$tabnm% -info] /* delete file &type [quote Generating [upcase %dts$tabtype%] DTS INFO Table...] &call %dts$routinenm% /* call routine make boundary table &end /* if query &else &do &type [quote Not deleting or generating table %dts$tabnm%...] &end /* if else query &end /* if exist &else &do &type [quote Generating [upcase %dts$tabtype%] DTS INFO Table...] &call %dts$routinenm% /* call routine make boundary table &end /* if else exist &return /* gentable /*------------------- &routine GENALLTABLES /*------------------- /* generate all tables. Prompts user if wants to delete all tables first. /* If user does not delete then no tables are generated. /* query to see if user wants to delete all tables &type &type [quote If you proceed, all current data transfer files will be] &type [quote deleted and all new files will be generated.] &if [query 'Do you want to delete all tables and generate new ones' .true.] &then &do &type [quote Deleting and generating all DTS INFO tables...] &do dts$file &list %dts$difftabs% &if [exists dts%dts$file% -info] &then &do &s bunk = [delete dts%dts$file% -info] /* delete file &end /* if exist &s dts$tabnm = dts%dts$file% &call make%dts$file% /* call routine make boundary table &end /* do list difftabs &end /* if query &else &do &type [quote Not deleting or generating all tables...] &end /* if else query &return /* gentable /*--------------- &routine MAKEBDRY /*--------------- /* /* defines the boundary info table. /* define the new table define %dts$tabnm% bdryshpid,10,10,i fwbdryid,10,10,i bdryestdt,8,8,i bdryoldist,6,6,n,3 bdryordist,6,6,n,3 bdrybndtxt,240,240,c bdrystatxt,240,240,c bdrytxt,40,40,c bdryelev,8,8,n,3 vertumeaid,2,2,i vertmmetcd,2,2,i vertmaccd,2,2,i bdrymtycd,2,2,i bdrymlng,10,10,n,2 linumeasid,2,2,i linmmetcd,2,2,i linmaccd,2,2,i bdrymdeflg,1,1,c linadirang,8,8,n,5 bdrymdrqcd,2,2,c bdrydrtycd,2,2,i angumeasid,2,2,i bdrydstycd,2,2,i docid,10,10,i ~ &return /* end routine MAKEBDRY /*----------------- &routine MAKEBDRYTY /*----------------- /* /* defines the boundary type info table. /* define the new table define %dts$tabnm% bdryshpid,10,10,i bdrytycd,2,2,i ~ &return /* end routine MAKEBDRYTY /*----------------- &routine MAKEBDRYPT /*----------------- /* /* defines the boundary point relationship info table. /* define the new table define %dts$tabnm% bdryshpid,10,10,i pointshpid,10,10,i ~ &return /* end routine MAKEBDRYPT /*-------------------- &routine MAKECNRCLQUAL /*-------------------- /* /* defines the corner class qualifier info table. /* define the new table define %dts$tabnm% pointshpid,10,10,i cnrclstycd,2,2,i cnrcqltycd,2,2,i ~ &return /* end routine MAKECNRCLQUAL /*-------------- &routine MAKEDOC /*-------------- /* /* defines the document info table. /* define the new table define %dts$tabnm% docid,10,10,i doctypecd,2,2,i docdt,8,8,i docnm,32,32,c docsrctxt,240,240,c docremstxt,240,240,c rpinstycd,2,2,i rpagrmtycd,2,2,c rpdnratycd,2,2,i rpconvtycd,2,2,i rpesmtycd,2,2,i rpdnrctycd,2,2,i rpredocflg,1,1,c conlifeflg,1,1,c conrevrflg,1,1,c rpinstrac,8,8,n,2 receivernm,240,240,c conveyornm,240,240,c concrnotxt,16,16,c tranarntxt,9,9,c rpexpirdt,8,8,i ~ &return /* end routine MAKEDOC /*---------------------- &routine MAKELANDPRCL /*---------------------- /* /* defines the land parcel info table. /* define the new table define %dts$tabnm% prclshpid,10,10,i fwprclid,10,10,i prclndarea,12,12,n,2 countyid,8,8,i cntyprclaq,12,12,n,2 cntytaxpno,36,36,c cntytxpucd,3,3,i cntytxpval,12,12,n,2 parprclid,10,10,i prclaqflg,1,1,c lurestycd,2,2,i lureseffdt,8,8,i lurestxt,240,240,c luresarea,12,12,n,2 aqprclascd,2,2,i aqprcltycd,2,2,i landatycd,2,2,i fwprclnm,50,50,c ~ &return /* end routine MAKELANDPARCEL /*---------------------- &routine MAKEPRCLTYPE /*---------------------- /* /* defines the land parcel type info table. /* define the new table define %dts$tabnm% prclshpid,10,10,i prcltycd,3,3,i ~ &return /* end routine MAKELANDPARCEL /*---------------------- &routine MAKEPRCLRT /*---------------------- /* /* defines the land parcel right info table. /* define the new table define %dts$tabnm% fwprclsyid,10,10,i prclshpid,10,10,i ownrtycd,2,2,i mgmbnftacd,2,2,i mgmbcntyid,8,8,i ownrttaedt,8,8,i ownrtdsflg,1,1,c ownrtmdtxt,240,240,c ownrtlmtxt,240,240,c ownrtmatxt,240,240,c ~ &return /* end routine MAKEPRCLRIGHT /*---------------------- &routine MAKEPRCLAGNTDOC /*---------------------- /* /* defines the parcel agent document info table. /* define the new table define %dts$tabnm% fwprclsyid,10,10,i prclshpid,10,10,i agentid,10,10,i landintycd,2,2,i landrptycd,2,2,i docid,10,10,i agntintpc,12,12,n,4 agntvltycd,2,2,i agntdnotxt,12,12,c agntdvltxt,12,12,c agntdpgtxt,12,12,c agntfnotxt,20,20,c agntcnotxt,20,20,c agntowtycd,2,2,i recdt,8,8,i recafntxt,24,24,c recbarntxt,24,24,c ~ &return /* end routine MAKEPRCLAGNTDOC /*------------------ &routine MAKEPRCLLAD /*------------------ /* /* defines the parcel to legal area description relationship info table. /* define the new table define %dts$tabnm% prclshpid,10,10,i ladshpid,10,10,i ~ &return /* end routine MAKEPRCLLAD /*------------------ &routine MAKELAD /*------------------ /* /* defines the legal area description info table. /* define the new table define %dts$tabnm% ladshpid,10,10,i fwladid,10,10,i fwladpntid,10,10,i ladtypecd,2,2,i ladlabltxt,50,50,c plstwpwlno,2,2,i plstwpfrcd,2,2,i plstwpdrcd,2,2,c plsrngwlno,2,2,i plsrngfrcd,2,2,i plsrngdrcd,2,2,c plstwpdflg,1,1,c plstwpstcd,2,2,i plstwpsdno,8,8,i plstwpsdnm,240,240,c plssddsflg,1,1,c sectsdtycd,2,2,i plsal4cd,2,2,c plsal16cd,2,2,c plsal64cd,2,2,c plsal256cd,2,2,c plsal1024cd,2,2,c plstlotpno,8,8,i plslpdsflg,1,1,c nonplstycd,2,2,i nonplsdflg,1,1,c nonplsplnm,240,240,c nonplsntxt,240,240,c nonplsubtr,8,8,c nonplsblk,8,8,c nonplslot,8,8,c nonplsetdt,8,8,i nonplsptxt,240,240,c fwladarea,12,12,n,2 areaumeaid,2,2,i areammetcd,2,2,i areamaccd,2,2,i docid,10,10,i ~ &return /* end routine MAKELAD /*------------------ &routine MAKELADBDRY /*------------------ /* /* defines the legal area description to boundary relationship info table. /* define the new table define %dts$tabnm% ladshpid,10,10,i bdryshpid,10,10,i ~ &return /* end routine MAKELADBDRY /*------------------ &routine MAKELADPT /*------------------ /* /* defines the legal area description to point relationship info table. /* define the new table define %dts$tabnm% ladshpid,10,10,i pointshpid,10,10,i plsgcdbtxt,6,6,c ~ &return /* end routine MAKELADPT /*------------------ &routine MAKEPOINT /*------------------ /* /* defines the point info table. /* define the new table define %dts$tabnm% pointshpid,10,10,i fwpointid,10,10,i cornerid,10,10,i cnrlbltxt,64,64,c pointtycd,2,2,i pntlatcord,14,14,n,11 pntlngcord,15,15,n,11 pntvrtcord,7,7,n,3 pntestdt,8,8,i pntprojnm,240,240,c geopntnm,40,40,c geopntatxt,40,40,c geopntptxt,16,16,c sigcordnm,30,30,c sigcordesc,240,240,c cnrpntaflg,1,1,c cnrpntadt,8,8,i cnrpntdflg,1,1,c cnrpntmscd,2,2,i hzmtypecd,2,2,i plcrdsysid,2,2,i hzmdatycd,2,2,i hzmgltcord,14,14,n,11 hzmglgcord,15,15,n,11 hzmpewxcrd,11,11,n,3 hzmpnsycrd,11,11,n,3 hzumeasid,2,2,i hzmmethcd,2,2,i hzmaccycd,2,2,i vrtmzcord,8,8,n,3 vrtmaccflg,1,1,c vrtmdatcd,2,2,i vrtumeasid,2,2,i vrtmmethcd,2,2,i vrtmaccycd,2,2,i monsetdt,8,8,i montypecd,2,2,i monsetycd,3,3,i monstmptxt,50,50,c mondesctxt,240,240,c monacsytxt,240,240,c monaccstxt,240,240,c recovdt,8,8,i recovtycd,2,2,i recovcntxt,40,40,c docid,10,10,i ~ &return /* end routine MAKEPOINT /*--------------- &routine MAKETRAN /*--------------- /* /* defines the transaction info table. /* define the new table define %dts$tabnm% fwtransid,10,10,i agentid,10,10,i transdesc,240,240,c transcomnt,240,240,c ~ &return /* end routine MAKETRAN /*------------ &routine USAGE /*------------ &s routinename = USAGE /* set routine error name &type [quote Usage: CADASTRE_DTS_INFO <Table Type: BDRY (Boundary)] &type [format'%1,-44% (%2%)' BDRYTY 'Boundary Type'] &type [format'%1,-44% (%2%)' BDRYPT 'Boundary - Point'] &type [format'%1,-47% (%2%)' CNRCLQUAL 'Corner Class Qualifier'] &type [format'%1,-41% (%2%)' DOC 'Document'] &type [format'%1,-41% (%2%)' LAD 'Legal Area Description'] &type [format'%1,-45% (%2%)' LADBDRY 'Legal Area Description - Boundary'] &type [format'%1,-43% (%2%)' LADPT 'Legal Area Description - Point'] &type [format'%1,-43% (%2%)' POINT 'Point'] &type [format'%1,-46% (%2%)' LANDPRCL 'Land Parcel'] &type [format'%1,-49% (%2%)' PRCLAGNTDOC 'Parcel Agent Document'] &type [format'%1,-46% (%2%)' PRCLTYPE 'Parcel Type'] &type [format'%1,-44% (%2%)' PRCLRT 'Parcel Right'] &type [format'%1,-45% (%2%)' PRCLLAD 'Parcel - Legal Area Description'] &type [format'%1,-42% (%2%)' TRAN 'Transaction'] &type [format'%1,-41% (%2%)>' ALL 'All Tables'] &return /* end routine USAGE /*----------- &routine EXIT /*----------- /* informs user exiting program and deletes program variables. /* if in tables, quit &if [show program] = TABLES &then &do /* quit tables &type Quiting TABLES... quit &end /* if show program ne arc /* inform user exiting Boundray Cadastral DTS INFO Program... &type Exiting Boundary Cadastral DTS INFO Program... /* delete program variables &delvar dts$* /* delete program variables &return &inform End of program CADASTRE_DTS_INFO.AML /* end routine EXIT and end program /*-------------- &routine BAILOUT /*-------------- &severity &error &ignore &messages &on &type [quote An error has occurred in program CADASTRE_DTS_INFO.AML.] &call exit &return &warning