Documentation
A manual is available as Word document or a PDF.
XML Examples
Delimited.pzmap.xml
<?xml version="1.0"?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<COLUMN name="FIRSTNAME" />
<COLUMN name="LASTNAME" />
<COLUMN name="ADDRESS" />
<COLUMN name="CITY" />
<COLUMN name="STATE" />
<COLUMN name="ZIP" />
</PZMAP>
DelimitedWithHeaderAndTrailer.pzmap.xml
<?xml version='1.0'?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<RECORD id="header" indicator="H" elementNumber="1">
<COLUMN name="RECORDINDICATOR" />
<COLUMN name="HEADERDATA" />
</RECORD>
<COLUMN name="FIRSTNAME" />
<COLUMN name="LASTNAME" />
<COLUMN name="ADDRESS" />
<COLUMN name="CITY" />
<COLUMN name="STATE" />
<COLUMN name="ZIP" />
<RECORD id="trailer" indicator="T" elementNumber="1">
<COLUMN name="RECORDINDICATOR" />
<COLUMN name="TRAILERDATA" />
</RECORD>
</PZMAP>
FixedLength.pzmap.xml
<?xml version="1.0"?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<COLUMN name="FIRSTNAME" length="35" />
<COLUMN name="LASTNAME" length="35" />
<COLUMN name="ADDRESS" length="100" />
<COLUMN name="CITY" length="100" />
<COLUMN name="STATE" length="2" />
<COLUMN name="ZIP" length="5" />
</PZMAP>
FixedLengthWithHeaderAndTrailer.pzmap.xml
<?xml version='1.0'?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<RECORD id="header" startPosition="1" endPosition="7" indicator="HEADER ">
<COLUMN name="INDICATOR" length="7" />
<COLUMN name="HEADERDATA" length="19" />
</RECORD>
<COLUMN name="FIRSTNAME" length="35" />
<COLUMN name="LASTNAME" length="35" />
<COLUMN name="ADDRESS" length="100" />
<COLUMN name="CITY" length="100" />
<COLUMN name="STATE" length="2" />
<COLUMN name="ZIP" length="5" />
<RECORD id="trailer" startPosition="1" endPosition="7" indicator="TRAILER">
<COLUMN name="INDICATOR" length="7" />
<COLUMN name="TRAILERDATA" length="19" />
</RECORD>
</PZMAP>
SQLTableLayout
Below is the layout for the 2 sql tables needed to map column names in a text file.
THIS IS ONLY NEEDED IF NOT USING THE PZMAP XML to map columns.
This should work with just about any database. The contructor for the DataSet class accepts
a java.sql.Connection object if using this mapping method.
TABLE1:
>Table Name: DATAFILE
*Column: DATAFILE_NO - Numeric <PK>
*Column: DATAFILE_DESC - VarChar(45) - the value of this column is what needs to be passed into the
dataDefinition parameter on the DataSet constructor.
TABLE2:
>Table Name: DATASTRUCTURE
*Column: DATASTRUCTURE_NO - Numeric <PK>
*Column: DATAFILE_NO - Numeric <FK> - Links to DATAFILE table
*Column: DATASTRUCTURE_COLUMN - VarChar(100) - Name of the column to map
*Column: DATASTRUCTURE_LENGTH - Numeric - Length of the column, ONLY APPLIES TO FIXED LENGTH FILES
*Column: DATASTRUCTURE_COL_ORDER - Numeric - Numerical ordering columns appear in file 1,2,3...etc