COBOL Manual for TNS and TNS/R Programs

Migrating TNS Programs to Native Programs
HP COBOL Manual for TNS and TNS/R Programs522555-006
33-5
Migrating HP COBOL Programs
°
FORTRAN and Pascal
There are no native FORTRAN or Pascal compilers. Rewrite FORTRAN and
Pascal programs in native HP C, native HP C++, native HP COBOL, or pTAL.
You need not use the same language for all of them.
°
Data Alignment
The COBOL85 and NMCOBOL compilers generate code with the same data
alignment. You need not change any data alignment directives before
migrating a TNS HP COBOL program to native HP COBOL. You need not
regenerate Data Definition Language (DDL) source files that TNS HP COBOL
and native HP COBOL programs share.
The ECOBOL compiler aligns each level-01 item and each level-77 item on a
physical 8-byte boundary, not on a physical 2-byte boundary as the COBOL85
and NMCOBOL compilers do. Offsets from the containing level-01 or level-77
item are the same in all three compilers. The difference in alignment of level-01
and level-77 items for the ECOBOL compiler will not affect a program unless
the program depends on the relative placement in memory of distinct level-01
or level-77 items. If your program depends on such relative placement, correct
it.
By default, the TNS compilers for HP C, HP C++, and TAL generate code with
different data alignment than the corresponding native compilers for HP C,
HP C++, and pTAL. To migrate a TNS HP C, TNS HP C++, or TAL program to
native mode, you must do one of:
°
If DDL was not used, use SHARED2 pragmas in pTAL programs and
CSHARED2 pragmas in native HP 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 the TNS/R Native
Application Migration Guide.
See also Data Alignment.
5. (Optional) Put converted routines in a user library.
If you want to put the routines that you converted to native mode in Step 4 in a user
library (instead of in a TNS user library, which your program can no longer use),
follow the directions in User Library.