next up previous contents index
Next: 2.2 Text to XML Up: 2. Principles of conversion Previous: 2. Principles of conversion   Contents   Index

Subsections


2.1 COBOL copybook analysis

The analysis take place in 3 phases :


2.1.1 ''Cleaning'' the copybook

In this phase, the copybook is read and :


2.1.2 Extracting the meta-data

In this phase, the following meta-data are extracted :

Meta-data Usage
COBOL level

FILLER clauses are not skipped. They are used to compute the starting positions of all COBOL items. They never appears in the XML file when the text to XML conversion process ends. The copybook is also checked for unsupported COBOL clauses :

and for partially supported COBOL clauses :


2.1.3 Renumbering the COBOL item levels

As COBOL item levels are used to indent tags during text to XML conversion, they are internally renumbered to have a smoother indentation. For example, the following COBOL copybooks :

Figure: A sample COBOL copybook
\begin{figure}\par\par
\begin{list}{}{
\setlength{\rightmargin}{\leftmargin...
...par
\textbf{05 COBOL-ITEM-02 PIC IS X(5).}\end{list}
\end{list}\par
\end{figure}

and

Figure: Same sample COBOL copybook with different levels
\begin{figure}\par\par
\begin{list}{}{
\setlength{\rightmargin}{\leftmargin...
...par
\textbf{20 COBOL-ITEM-02 PIC IS X(5).}\end{list}
\end{list}\par
\end{figure}

will always give the same indentation, like in the following XML file :

Figure: Resulting XML file after conversion
\begin{figure}\par\par
\begin{list}{}{
\setlength{\rightmargin}{\leftmargin...
...xtbf{</COBOL\_ITEM\_01>}
\end{list}
\textbf{</DATA>}\end{list}\par
\end{figure}

The original COBOL copybook is never modified by TXT2XML and if the conversion ends without errors, a report of this analysis is printed.


next up previous contents index
Next: 2.2 Text to XML Up: 2. Principles of conversion Previous: 2. Principles of conversion   Contents   Index
sunuraxi@users.sourceforge.net