TNS/E Native Application Conversion Guide

Converting COBOL Programs
TNS/E Native Application Conversion Guide529659-003
4-3
Converting COBOL Programs
If any of your TAL programs use the FORTRAN convention for determining the
length of a string parameter (that is, if they use the ENTER routine and do not
specify the language TAL), convert them to use another method. (For example,
use the
string
:
length
convention or pass the length as a separate
parameter.)
For information on tools that can help you convert TAL programs to pTAL
programs, see Section 5, Converting TAL to pTAL.
FORTRAN and Pascal
There are no native FORTRAN or Pascal compilers. Rewrite FORTRAN and
Pascal programs in native C, native C++, native COBOL, or pTAL. You need
not use the same language for all of them.
Data Alignment
The alignment of certain data items differs between TNS COBOL and native
COBOL. The native COBOL compiler aligns each level-01 and each level-77
item on a physical 8-byte boundary, whereas the TNS COBOL compiler aligns
these items on a physical 2-byte boundary. Offsets from the containing level-01
or level-77 item are the same in both compilers. The difference in alignment of
level-01 and level-77 items will not affect a program unless the program
depends on the relative placement in memory of particular level-01 or level-77
items. Any programs that have this dependency should be changed to remove
the dependency.
By default, the TNS compilers for C, C++, and TAL generate code with different
data alignment than the corresponding native compilers for C, C++, and pTAL.
To convert a TNS C, TNS C++, or TAL program to native mode, you must do
one of the following:
°
If DDL was not used, use SHARED2 pragmas in pTAL programs and
CSHARED2 pragmas in native C programs.
°
If DDL was used, regenerate DDL source files that TNS and native
programs share.
DDL adds pragmas to ensure that all compilers generate code with the
same data alignment. For more information, see Section 7, Converting
Data Definition Language (DDL).
5. If you want to put the routines that you converted to native mode in Step 4 in a DLL
(instead of in a TNS user library, which your program can no longer use), follow the
directions in the
COBOL Manual for TNS and TNS/R Programs
.