The Parameter Management (PRM) service enables you to manipulate application-defined parameters in the same manner as other Natural Access service parameters. After you initialize user-specified parameters through the PRM service, the application can retrieve and modify defined parameters in shared memory, process global memory, or on a context basis.
Define parameters in an ASCII text file and load them using the PRM service. The PRM service can load the ASCII definition files or encoded binary versions of the ASCII files. Encode your parameter files if you want to discourage modification by end users.
Complete the following steps to define and use application-specific parameters under Natural Access:
Step |
Action |
1 |
Create an ASCII text parameter file (prmxxx.pf, where prm is the prefix, xxx identifies the file, and .pf is the file extension) using any ASCII text editor (such as Microsoft Notepad, vi, emacs). |
2 |
Encode the ASCII file into a binary parameter file using the pfencode conversion utility (optional). |
3 |
Ensure that the resulting .pf file is in a directory that is contained in the list of directories specified by the CTA_DPATH environment variable so that the Parameter Management service automatically loads it at application startup. Note: The file name of the text parameter or encoded binary parameter file intended for PRM service must have the prm prefix as part of the parameter file name. Without this prefix, the PRM service will not load your parameter file. |
4 |
Run ctaparm from the command line to ensure that Service = prm, prmmgr is specified in cta.cfg. Refer to the defined parameters listed in the output. |
5 |
In the application, specify the PRM service in addition to all other desired Natural Access services in the list passed to ctaInitialize. A CTA_SERVICE_NAME structure should be initialized to { "PRM","PRMMGR" } and included in the array of CTA_SERVICE_NAME structures passed to ctaInitialize. |
6 |
Use the supported Natural Access parameter functions to access your parameters. An application parameter can be accessed by name or by ID, just like any other Natural Access parameter. The naming convention is similar to the Natural Access parameter naming convention, except that the service name must be set to PRM. Use the following syntax to access application-specific parameters:
|