APINNSRC

This API lets obtain chunks of

  • Natural sources,

  • short error messages,

  • long error messages,

  • foreign sources,

  • USED (object) lists, and

  • USED BY (object) lists resident in the ACF.

APINNSRC can be invoked with:

CALLNAT 'APINNSRC' API-PARM API-NSRC-PARM
D To obtain a chunk of a Natural or foreign source or an error message.
U To obtain a chunk of the USED list of a PAC object
B To obtain a chunk of the USED BY list of a PAC object
S The value of API-PARM.API-SUB-FUNC is ignored except when API-PARM.API-MAIN-FUNC=D, in which case [API-PARM.API-SUB-FUNC] = S indicates that a short rather than long error message is required.

This document covers the following topics:


Local Data Area UOVLNSRC

A definition of API-NSRC-PARM is provided in LDA UOVLNSRC.

Field Name Format I/O
API-NSRC-PARM    
APPLICATION A32 in
OBJECT A32 in
VERSION-NUM N4 in/out
TYPE A15 in/out
LINE-CNT P5 in/out
OTHER-APPLICATION A32 (1:10) 1* out
SOURCE A94 (1:10) 1* out
PAC-AREA B23 in/out

1*: This is the proposed default value. Any value equal or greater 1 can be defined by the user.

When APINNSRC is called:

API-NSRC-PARM.APPLICATION should carry the name of the application in whose compartment the (versioned) object resides.

  • API-NSRC-PARM.OBJECT should carry the name of the object.

  • [API-NSRC-PARM.VERSION-NUM], if positive, is interpreted as the version number of the object; if negative or zero, it is interpreted as the highest available version number of an object in the given compartment, with the given (if TYPE not equal to ' ') or chosen (see below) type.

  • [API-NSRC-PARM.TYPE], if non-blank, is interpreted as the type designation of the object; if blank, it is interpreted as the lexicographically least available type designation of an object in the given compartment, with the given name.

The possibility to specify the type of the required object is new.

The type designations to be used are the following:

NA Parameter data area
NC Copycode
NG Global data area
NH Helproutine
NL Local data area
NM Map
NN Subprogram
NP Program
NS Subroutine
NT Text
EN Error message
VIEW DDM
RULE Rule
AFIA ADABAS file
AFIU User file
  • For foreign objects, their four-character type designations beginning in '3' can be used.

  • [API-NSRC-PARM.LINE-CNT] is made 0, if negative; it is made 10, if greater than 10. It is then interpreted as the number of lines (the size of the chunk) to be returned; no lines will be returned, if LINE-CNT = 0.

  • Normally, API-NSRC-PARM.PAC-AREA should be reset when the first chunk of the object's source or list is required and left untouched for a next call to obtain an immediately following chunk of the same source or list. If the (three) directory lines are to be part of the first chunk, H'F0F0F1' should be put in bytes 18 - 20 of API-NSRC-PARM.PAC-AREA.

    If an object satisfying the selection criteria is found, a positive [API-NSRC-PARM.VERSION-NUM] and a non-blank [API-NSRC-PARM.TYPE] are returned.

    APINNSRC returns in API-NSRC-PARM.LINE-CNT the number of lines (the size) of the returned chunk. It may be less than the adjusted original value if the end of the source or list has been reached.

  • If API-PARM.API-MAIN-FUNC = 'D' then APINNSCR returns blanks in API-NSRC-PARM.OTHER-APPLICATION(1: API-NSRC-PARM.LINE-CNT).

  • If API-PARM.API-MAIN-FUNC = 'U', I GE 1, and I LE API-NSRC-PARM.LINE.CNT then APINNSCR returns a blank in API-NSRC-PARM.OTHER-APPLICATION(I) unless API-NSRC-PARM.SOURCE(I) contains a refernce to an object of an application other than API-NSRC-PARM.APPLICATION, in which case the name of the other application is put into API-NSRC-PARM.OTHER-APPLICATION(I).

  • If API-PARM.API-MAIN-FUNC = 'B', I GE 1, and I LE API-NSRC-PARM.LINE.CNT then APINNSCR puts into API-NSRC-PARM.OTHER-APPLICATION(I) the name of the application of the object referred to in API-NSRC-PARM.SOURCE(I).

API Return Codes

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

0000 if the object has been found and a non-final chunk is being returned,
1011 if the specified, ([API-PARM.API-MAIN-FUNC],[API-PARM.API-SUB-FUNC]) is meaningless,
7251 if the object has not been found,
7255 if the object has been found and a final chunk is being returned.

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