APINAPP

API Routine: APINAPP
Parameters: UGNLPARM, UPILAPP

This API lets obtain data from a PAC application, create a new application, and modify an existing one.

APINAPP can be invoked with:

CALLNAT 'APINAPP' API-PARM API-APP-PARM

A definition of API-PARM is provided in LDA UGNLPARM in library SYSPACUS.

Set API-PARM.API-MAIN-FUNC to:

A To add a Natural application.
B To add a Predict application.
D To obtain data from an application.
M To modify an application.

This document covers the following topics:


Local Data Area UPILAPP

A definition of API-APP-PARM is provided in LDA UPILAPP in library SYSPACUS.

Field Name Format Description
API-APP-PARM    
APPL-TYPE A1 out
APPLICATION A32 in
PREFIX A3 in/out
LEVEL A10 in/out
GEN-NUMBER P5 in/out
TITLE A60 in/out
MCG A4 in/out
PRD-APPL A32 in/out
VIEW-SECURITY A1 in/out
STEPLIB-CNT N3 out
STEPLIB A32 (1:8) in/out
FRG-TYPE-CNT N3 out
FRG-TYPE A4 (1:100) in/out
MIN-CURR-VERS P3 in/out
CURR-RETENTION-PERIOD P3 in/out
MIN-ARCH-VERS P3 in/out
ARCH-RETENTION-PERIOD P3 in/out
LOG-PURGES A1 in/out
PRD-CASE-USAGE A1 in/out
DB2-SUPPORT A1 in/out
LIB-DEV A8 in/out
LIB-INC A8 in/out
LIB-MAINT A8 in/out
LIB-TEST A8 in/out
ADD-TIME T out
ADD-BY A8 out
ADD-TID A8 out
MOD-TIME T out
MOD-BY A8 out
MOD-TID A8 out

Whenever APINAPP is called, API-APP-PARM.APPLICATION should carry the name of the application.

If [API-PARM.API-MAIN-FUNC] = 'D' and the application is found, APINAPP returns in the remaining parameter fields the application data, ignoring any values put by the user in the "in/out" fields.

[API-APP-PARM.STEPLIB-CNT] is the number of the application's step applications. Their names are returned in API-APP-PARM.STEPLIB(1:[API-APP-PARM.STEPLIB-CNT]).

[API-APP-PARM.FRG-TYPE-CNT] is the number of the foreign object types associated with the application. The codes of the types are returned in API-APP-PARM.FRG-TYPE(1:[API-APP-PARM.FRG-TYPE-CNT]).

If [API-PARM.API-MAIN-FUNC] = 'A' and the application is not found, APINAPP tries to add a NATURAL application with the characteristics specified in the "in/out" fields.

If [API-PARM.API-MAIN-FUNC] = 'B' and the application is not found, APINAPP tries to add a PREDICT application with the characteristics specified in the "in/out" fields.

If [API-PARM.API-MAIN-FUNC] = 'M' and the application is found, APINAPP tries to modify the application endowing it with the characteristics specified in the "in/out" fields.

The meaningful values of the "in/out" fields are enumerated in the following table:

Field Name Format Possible Values
PREFIX A3 any
LEVEL A10 any
GEN-NUMBER P5 any non-negative
TITLE A60 any
MCG A4 a sequence of I, M, N, O, W, Y
PRD-APPL A32 the name of a Predict application or blank
VIEW-SECURITY A1 A, D, U
STEPLIB A32 (1:8) the names of Natural applications or blank
FRG-TYPE A4 (1:100) codes of foreign object types or blank
MIN-CURR-VERS P3 any non-negative
CURR-RETENTION-PERIOD P3 any non-negative
MIN-ARCH-VERS P3 any non-negative
ARCH-RETENTION-PERIOD P3 any non-negative
LOG-PURGES A1 N, Y
PRD-CASE-USAGE A1 N, Y
DB2-SUPPORT A1 N, Y
LIB-DEV A8 any
LIB-INC A8 any
LIB-MAINT A8 any
LIB-TEST A8 any

With any of the four meaningful values of API-PARM.API-MAIN-FUNC the significance of the values of the API-APP-PARM fields is the same as that of their menu system counterparts.

At application addition or modification user-specified values of the "in/out" fields may be translated.

Embedded spaces are replaced with '_' in user-specified values of PREFIX and LEVEL.

A meaningless value of PRD-APPL specified for the addition or modification of a Natural application causes the function to be abandoned. Other meaningless values of the "in/out" fields are treated as follows:

Field Name Format Possible Values
GEN-NUMBER P5 A negative is translated to 0.
MCG A4 Meaningless characters are skipped.
VIEW-SECURITY A1 Meaningless character is translated to 'U'.
STEPLIB A32 (1:8) Strings that are not Natural application names are skipped.
FRG-TYPE A4 (1:100) Strings that are not codes of foreign object types are skipped
MIN-CURR-VERS P3 A negative is is translated to 0.
CURR-RETENTION-PERIOD P3 A negative is is translated to 0.
MIN-ARCH-VERS P3 A negative is is translated to 0.
ARCH-RETENTION-PERIOD P3 A negative is is translated to 0.
LOG-PURGES A1 A meaningless character is translated to 'N'.
PRD-CASE-USAGE A1 A meaningless character is translated to 'N'.
DB2-SUPPORT A1 A meaningless character is translated to 'N'.

API Return Codes

APINAPP returns the following [API-PARM.API-MSG-NO]:

1011 if an [API-PARM.API-MAIN-FUNC] distinct from 'A', 'B', 'D', and 'M' has been specified.
7201 if an ACF control record has been found defective.
7205 if the "initialisation" has failed, ie, logical files 210 and 211 have not been found set at a pair of matching ACF and PCF.
7250 if the application has been found.
7251 if an application has not been found.
7253 if the application has been added.
7254 if the application has been modified.
7257 if the application has not been added.
7259 if the application has not been modified.
7541 if the application (to be modified) is locked.

Other values of API-PARM.API-MSG-NO may be received in more unusual situations.