TNS/R Native Application Migration Guide

TNS/R Native Application Migration Guide523745-001
6-1
6 User Library Migration Tasks
This section describes how to migrate a TNS user library to a native user library. It
describes how to build a native user library and to associate a native user library with a
native program file.
A user library is an object file that the operating system links to a program file at run
time. C, C++, COBOL85, TAL, and pTAL programs can have a user library. There are
two types of user libraries: TNS user libraries and native user libraries. A TNS user
library is available to TNS processes in the Guardian environment. A native user library
is available to native processes in the Guardian and OSS environments.
Native user libraries are a special form of shared run-time libraries (SRL), called a
private SRL. A program can have only one native user library.
Differences between TNS user libraries and native user libraries are:
Neither TNS user libraries nor native user libraries can contain embedded SQL
statements. Move functions with embedded SQL statements to user code before
migrating a TNS user library to a native user library.
Building a User Library
Building a native user library is nearly the same as building a TNS user library. To build
a native user library:
1. Remove pragmas and directives:
In C and C++, remove ENV LIBRARY pragmas from source code files and the
compiler RUN command line.
In COBOL85 and pTAL, remove ENV LIBRARY directives from source code
files.
TNS User Libraries Native User Libraries
Either or both the program file and user
library file can be accelerated (processed by
the Accelerator).
Both the program file and user library file
must be compiled with native compilers.
Can call a limited subset of the C run-time
library.
Can call any function in the C run-time
library.
A COBOL85 user library specified at
compilation time can be overridden at run
time.
A COBOL85 user library specified at
compilation time cannot be overridden at run
time.