Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

In some cases, interprocess communication features can be added to a Guardian application to
set up communication channels with OSS applications. To make your Guardian application as
open as possible, and, therefore, in a position to access new open facilities as they are introduced,
you can migrate your application to run in the OSS environment. The next few subsections introduce
various aspects of migrating your Guardian application.
Converting TAL or pTAL Code to C or C++
Many existing Guardian programs are written in TAL or pTAL, which are HP programming
languages; some of these programs are not CRE-compliant. Migrating these programs to a more
open environment involves writing or rewriting them in the C or C++ language. To do this by hand
is a tremendous undertaking. Some third-party tools have been developed to help with the effort
of converting TAL or pTAL programs to C, but none of them do the complete job. Particularly, if
the programs are not CRE-compliant, much of the conversion effort must be done by hand.
Using New and Extended Guardian Procedures in Guardian Programs
Extensions to existing Guardian procedures as well as open-oriented Guardian procedures give
Guardian applications better access to OSS features. The manipulation of OSS objects from the
Guardian environment provides a greater degree of openness for the Guardian application
program. In addition, using these procedures and extended Guardian procedures make it easier
to migrate a Guardian program to the OSS environment in the future.
The Guardian procedures introduced and extended to promote this interoperability with the OSS
environment are documented under “Using New and Extended Guardian Procedures (page 143).
These Guardian procedures support security, file system, and process management in the OSS
environment.
Using OSS Functions in a Guardian Program
More open features are available to a Guardian program with the use of OSS functions, most of
which can be called from a Guardian program. Refer to the API interoperability tables in the Open
System Services Programmer’s Guide for a complete list of OSS functions that you can use to
provide open features to Guardian programs. Moreover, Guardian processes can take on some
OSS attributes. Many of these attributes can be manipulated only using OSS functions, which are
noted in the interoperability tables.
Communicating With OSS Programs
Another way to build more openness into your Guardian application is to support communication
capabilities with OSS programs by using any one of a number of IPC mechanisms described in
some detail in Chapter 6 (page 85). The use of these communication mechanisms, along with the
ability to create OSS processes from the Guardian environment, give Guardian programs a
significant degree of interoperability with OSS programs.
Migrating a Guardian Program to the OSS Environment
The greatest degree of openness is provided by migrating the Guardian application to run in the
OSS environment. Before migrating your Guardian application to the OSS environment, make
sure that the Guardian functions used by your application either are supported in the OSS
environment or can be replaced by equivalent OSS functions. If the functions used by the Guardian
application cannot be used in the OSS environment, they must be replaced with equivalent OSS
functions in order to migrate the application. If the Guardian application is started from the Guardian
environment in a manner not supported in the OSS environment, for example by using ASSIGNs,
DEFINEs, PARAMs, or system startup messages, this capability will need to be provided by
equivalent mechanisms in the OSS environment.
The features of a specific product used by your application might also impose migration
considerations. For example, migration of a SQL/MP or SQL/MX program to the OSS environment
138 Migrating Guardian Applications to the OSS Environment