Program-Specific Maintenance

Standard maintenance functions are described in the section Maintenance in Predict in the Predict Reference documentation.

This document covers the following topics:


Editing Child Lists

To edit the lists of entry points, programs and files linked to a program, call the object list editor using one of the following methods:

  • Enter Y in the field Associations at the bottom of the Add, Copy or Modify program screens and select Uses PR concept./Uses FI concept.. An asterisk before one of these fields indicates that the program already contains a list of programs or files for the association.

  • Call the function Edit entry points or Link children in the Program Maintenance menu (codes R and L).

  • Enter command EDIT PROGRAM ENTRY <program ID> or LINK CHILDREN.

Overview of Language-Specific Program Types

The table below lists the program types permitted for a program written in a particular language and indicates whether the program can have a list of entry points. In third generation languages, marked * in the table below, functions and subprograms can be documented as programs of type F and N respectively, but any active references for these programs will have type P (main program). The active references of these programs will be correctly connected in the active retrieval functions to programs of types P, N and F.

Language Permitted Program Types Entry Points allowed?
B BAL (Assembler)* C D F I N P U yes
C COBOL* C D F I N P U yes
E Natural EL D Y no
F FORTRAN* C D F I N P yes
G ADA* C D F N P yes
H C* C D F I N P U yes
J Job Control Language D J no
N Natural A C D G H I K L M N O P S T X 1 4 5 no
O Other C D F H M N P yes
R Rexx R yes
P PL/I* C D F I N P U yes
Q Static SQL D I P   yes
S SQL procedure language R U no
V Java R yes
Z System program D E yes
0 - 9 user-defined  C D F N P no

New languages (code 0 - 9) are defined with the program U-PGMLAN. See the section U-PGMLAN - Define New Program Language in the section User Exits in the Predict Administration documentation.

Combinations of Parameters for Natural Programs

If the same member is used in several libraries, multiple documentation of this member can be avoided by omitting parts of the implementation pointer. Predict then finds out for itself all the libraries in which this member exists. In the example below, the library name is omitted.

The valid combinations of implementation pointer parameters permitted for Natural programs are shown below.

Member Y Y Y Y
Library   Y Y Y
Fnr     Y Y
DBnr       Y

Program List Specific Editor Commands

The following commands are available when editing one of the following lists:

  • Uses FI conceptually

  • Entry point list

  • Uses PR conceptually

ACTIVE

Insert information from XRef data into the object list. Mark objects that are used with <active, and mark objects that are not used with <unused. XRef data without a corresponding documentation object is marked *NOT DOCUMENTED*. An object ID can then be entered and the .E command can be used to create a Predict object corresponding to the XRef data. The implementation pointer for the new object is derived from XRef data and automatically inserted into the input fields of the Add menu.

UPDATE

Update active reference data in the object list. Mark used objects with <active and delete unused objects from the list. Comments on the ACTIVE command (above) also apply to this command.

RESET

Switches back to normal edit mode after ACTIVE or UPDATE have been issued. Information displayed in the right column is no longer derived from XRef data but is taken from the Predict objects. All lines marked *NOT DOCUMENTED* are removed from the list. X and Y marks and scan values specified with the SCAN command are reset (as with the RESET command in any other list editor).

Generating Database Request Modules -DBRMs- from Program Objects of Language Q -Static SQL-

A Natural for DB2 database request module (DBRM) can be generated by the function CREATE DBRM of Natural DB2 from the list of entry points in a Predict object for a program of language Q (static SQL). See the section DB2 and SQL/DS in the Predict and Other Systems documentation.

Each entry point must be a Natural program that uses this DBRM. The Predict object should specify the member where the function GENERATE DBRM is to store the DBRM. The table below lists the columns of information that can be stored about entry points for a program of language Q only.

Column Meaning
NAT-lib The name of the library in which the Natural program is stored.
NAT-pgm The name of the member in which the Natural program is stored.
Typ The subtype of the Predict object for the Natural program.
Documentation The ID of the Predict object for the Natural program.

The name of each entry point is concatenated. For detailed information on how the name is created, see the section Static SQL in the Predict and Other Systems documentation. This name is used for the entry point when displaying the DBRM's Predict definition (retrieval function) or its active references (LIST XREF command).

For any type of program except Q, the names of the entry points are stored in a single column. The editor commands ACTIVE and UPDATE can be used to insert active reference data into an entry point list.

Purge Program - Code P

The following rules apply:

  • A program cannot be purged if it is linked to packagelist.

  • If a program is implemented, a message tells you that XRef data will be deleted, too.

Redocument Program - Code X

Creates Predict documentation objects for implemented programs (members). The function is used when redocumenting applications.

Predict retrieves the information needed to create the documentation object for a member either by scanning source code (only for Natural programs) or by evaluating XRef data.

Calling a Redocument Function

Online

Redocument functions are executed in two steps:

  1. Select the programs to be processed using the parameters in the first Redocument Program screen as selection criteria. See Selecting Programs to be Redocumented.

  2. Determine the scope of the redocumentation using parameters in the second Redocument Program screen. See Specifying the Redocument Parameters.

Batch Mode

The function Redocument program is one of the few maintenance commands that can be entered in batch mode. The additional parameters that can be specified and a sample REDOCUMENT command are given in the section Predict in Batch Mode in the Predict Administration documentation.

Redocumenting Programs under Natural Security

Under Natural Security, some restrictions apply to this function to prevent unauthorized access to Natural sources. The same logic is used as in the SYSMAIN utility to check the user's access rights. The switch SYSMAIN from Natural Security is also interpreted in the Redocument program function.

See section SYSMAIN under Natural Security in the Natural Security documentation for more information.

Selecting Programs to be Redocumented

Enter code X in the Program Maintenance menu to display the Redocument Program screen:

13:25:12             *****  P R E D I C T  *****             2007-05-31
Plan   0                   - Redocument program -



Member ...........                               File number ....... 54
Library ..........                               Database number ... 180
Language ........* N          Natural            Password ..........
Source/XRef ...... S (S/X)    Source             Cipher ............
Member types ....*            All
Parameters
Member name Name of the member to be redocumented. Asterisk notation can be used.
Library Depending on the parameter Source/XRef, either
  • library containing the members to be redocumented are stored, or

  • library of XRef data.

Language
B BAL/Assembler
C COBOL
F FORTRAN
G Language ADA
H Language C
N Natural
P PL/I
Q Static SQL
X All but Natural
If option X (All but Natural) is entered, Predict redocuments all 3GL programs that meet the specified selection criteria.
Source/XRef
S Source code is evaluated to create the Predict object (only for Natural programs).
X XRef data is evaluated.
Member type

Additional selection criterion. Only member of the given types will be redocumented. See Program Types for a list of types that can be specified.
A list of up to 9 member types can be specified. Member types can be specified without any delimiter (for example: ACGH)
For third generation languages, only P (program) can be specified.

File number, Database number Specify the FUSER file where the members to be processed are stored. Only applicable if Source/XRef is set to S.
Password, Cipher Password and cipher code defined in Adabas can be specified if required. Only applicable if Source/XRef is set to S.

Specifying the Redocument Parameters

The following screen appears if language type N is entered in the Redocument Program menu.

13:13:28             *****  P R E D I C T  *****              2007-05-31
Plan   0                   - Redocument program -

Processing options
  Processing option ..........* L  List only
  Link to system .............. GER-SY
  Library structure ..........*

Naming options (only applicable if 'Processing option' is 'Add')
  Program ID prefix ...........
  Lib.name as sec.prefix ...... Y (Y,N)

Contents of documentation                            Implementation pointer
  Abstract ...................* S  Statistics          Library .. Y (Y/N)
  Description ................* B  Header comment      Fnr ...... Y (Y/N)
  Replace/append description .. R (R/A)                DBnr ..... Y (Y/N)
  Program list ...............* U  Update
  File list ..................* U  Update
  Default owner ...............
  First default keyword .......
  Second default keyword ......
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
      Help  Next  Stop  Last  LnkEl Flip  Print Impl  AdmFi SelFi Prof  Main

Using Default Values

All parameters of the Redocument function can be set to default values by the data dictionary administrator in the Redocumentation Using Source Code screen, which is called by code R in the Modify General Defaults menu. Individual input fields can be protected. Protected default values cannot be overwritten. Protected fields are skipped when positioning the cursor with TAB.

Note:
Depending on the parameter Source/XRef (see table above), some parameters may not be contained in the screen. This is stated in the description of parameters below.

Processing options

Parameters
Processing option
Determines the type of processing performed by the redocument function. Valid values:
A Add: creates Predict objects for programs that are not already documented. Programs that meet the given selection criteria and are already documented will also be contained in the list and marked with the string Rejected in the column Status.
R Add and Replace: creates documentation for all programs that meet the given selection criteria. Existing documentation objects will then be replaced.
If the program is a class, the objects of type interface, method and property are also documented.
L List: lists programs that have not yet been documented in Predict. Programs that meet the given selection criteria and are already documented will also be contained in the list and will be marked with string Rejected in the column Status.
Link to system If Processing option is set to Add or Replace, the program objects created by the function are automatically linked as children to the specified System.
If no system is specified, Predict looks for a documentation object of type system with the given Library, DBnr and Fnr. The system object that meets most of these criteria is inserted in this input field.
Library structure You can specify a library structure that is used to determine the used programs. If no structure is specified, evaluation is performed without a library structure.

Naming options

Only applicable if Processing option=Add.

The ID of the program object created by the redocument function contains up to three parts, separated by hyphens.

Parameters
Program ID prefix A prefix that can be specified with the parameter Program ID prefix.
Lib.name as sec.prefix The library name of the member as secondary prefix, if the parameter Lib.name as sec.prefix is set to Y.
- The third part is the name of the member.

Contents of documentation

These parameters determine the information to be documented.

Parameters
Abstract
Determines the information to be contained in the abstract:
S Statistical data (including the date and time when a member was cataloged).
B Comment lines in the header. Only applicable if Source/XRef is set to S.
A Comment lines in the header and statistical information. Only applicable if Source/XRef is set to S.
N No abstract is created.
Description
Determines the information to be included in the extended description. Only applicable if Source/XRef is set to S.
A Comment lines. Start with either * or /* in the first column followed by a series of characters other than * or blank.
B All comment lines in the header of the member.
R Comment lines and remarks. A remark starts with /* in any column and is followed by a series of any non-blank characters.
S The whole source program.
N No extended description is created.
Replace/append descr.
Determines handling of extended descriptions. Only applicable if Source/XRef is set to S.
A The extended description of a Predict program object that is replaced (see Processing option above) is not overwritten. Instead, the new extended description is appended to the old extended description.
R The old extended description is overwritten when a Predict object is replaced. Default.
Program list
Programs that are called from within a program (for example via a CALL or FETCH statement) can be included in the program list (Uses PR concept.) of the object. The parameter Program list has the following options:
U Update. The old contents of the program list (Uses PR concept.) are completely replaced by the information extracted from the XRef data.
A Add active links. Additional entries in the program list (Uses PR concept.) are created, documenting the use of programs not already documented. All other entries in the list will be kept. This option only makes sense if an existing documentation object is replaced.
N No entries in the program list (Uses PR concept.) are created.
File list Files that are used by a program can be included in the file list Uses FI concept. of the program. See Program list above for description of the options.
Default owner The default Owner specified is included in the owner list of the object. The Owner must be defined in at least one object of type user. Only applicable if Processing option is set to A.
First default keyword Only applicable if Processing option is set to A.
Second default keyword Two keywords can be specified that are linked to the objects created. The keywords must be defined in Predict.
Implementation pointer:
Library, DBnr, Fnr
These parameters determine two things:
  • The amount of information to be stored in the implementation pointer of the Predict program object to be created by the Redocument function. If the library, DBnr or Fnr is to be added the implementation pointer by the redocument function, the respective parameter must be set to Y.

  • Which information of existing Predict program objects is evaluated to determine whether an implemented program is already documented.
    For example: if Library, DBnr and Fnr are set to Y, a Predict object is only regarded as the documentation of an implemented program if its implementation pointer contains correct values for the following:

    • member name

    • library

    • DBnr

    • Fnr.

Note:
If the parameters Implement. Library and Implement. DBNR/FNR in the Predict Defaults have been set to either Disallow (D) or Force (F), the parameters above cannot be set to Y or N respectively.

Handle /* in columns 1+2 as comment or as remark
C A line with /* in the first two columns is interpreted as a comment line.
R A line with /* in the first two columns is interpreted as a remark.
This parameter is specified in the defaults.

Edit procedure code of a program - Code Y

This function can only be executed for programs of type SQL procedure or Database function with language SQL procedure.

The Predict Description Editor is called. Additional checks are performed when the procedure code is cataloged. See the section Editors in Predict in the Predict Reference documentation for more information.