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 :
- comments are skipped,
- Multi-line COBOL declaration are concatenated in one line.
- PICTURE clauses are replaced by PIC,
- SIGN clauses are ignored,
- IS clauses are ignored,
- NATIVE clauses are skipped,
- X(4) and 9(6) symbols are replaced respectively by XXXX and 999999,
- Final dot of COBOL declarations is suppressed,
-
COBOL declarations are
capitalized.
2.1
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 :
- REDEFINES
- DEPENDING ON
-
COMPUTATIONAL-1, COMPUTATIONAL-2,
COMPUTATIONAL-5, COMP-1, COMP-2, and COMP-5.
- POINTER, PROCEDURE-POINTER and FUNCTION-POINTER
- OBJECT REFERENCE
- NATIONAL
- DISPLAY-12.2
- P symbol (decimal scaling position)
- INDEX
-
- Non-numeric COBOL levels or COBOL levels
greater than 49,
- DBCS picture symbols.
and for partially supported COBOL clauses :
- OCCURS for elementary
and group item with only one dimension,
- VALUES except for QUOTES and NULL 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
 |
and
-
-
Figure:
Same sample COBOL copybook with different levels
 |
will always give the same indentation, like in the following XML file
:
-
-
Figure:
Resulting XML file after conversion
 |
The original COBOL copybook is never modified by TXT2XML
and if the conversion ends without errors, a report of this analysis
is printed.
Next: 2.2 Text to XML
Up: 2. Principles of conversion
Previous: 2. Principles of conversion
Contents
Index
sunuraxi@users.sourceforge.net