Working with File Implementation Plans

When generating external objects from Predict file objects, several generation tasks can be executed comfortably in one run using an implementation plan. An implementation plan is defined online and can be executed either online or in batch mode.

This document covers the following topics:

The individual generation functions are described in Generation in this documentation.


Concepts of File Implementation

Generation functions can be executed from an implementation plan. Each generation task contained in an implementation plan calls a generation function once.

A generation task comprises the following:

  • the call of the generation function (for example GENERATE FDT)

  • the Predict file object to be processed

  • a complete set of generation options to be used for generation

  • status information.

Implementation plans can be created, extended, copied, displayed, modified, renamed, purged and executed. An implementation plan to be processed can be selected from a list.

Benefits of Implementation Plans

Whenever many generation operations are to be performed repeatedly, it is advisable to create an implementation plan containing the generation tasks. Here are some examples of where to use an implementation plan:

  • Creating DDMs for a Natural application. If all files to be used in an information processing system are defined in Predict, all DDMs to be used by Natural programs can easily be generated (and regenerated) using an implementation plan.

  • Creating all copy code used in an application written in a third generation language.

  • Implementing Vista elements for complex data distribution structures. If data is distributed across several machines in a complex (possibly heterogeneous) network, implementing the required Vista elements may require many calls of the generation function GENERATE VISTATAB. These calls can be executed comfortably from an implementation plan.

Note:
Using an implementation plan not only helps when several generation functions have to be called one after another, but also helps keep track of data structures of an application or of distributed data structures.

Overview of Activities

The following activities can or must be performed when using an implementation plan:

Create an Implementation Plan

Implementation plans are created with the Add implementation plan function by specifying a Plan ID in the File Implementation menu and - in the subsequent Add implementation plan screen - a combination of Predict selection criteria and generation function(s).

Extend an Implementation Plan

The function Extend implementation plan is used to add generation tasks for file objects that are not yet contained in the plan.

Modify an Implementation Plan

The function Modify implementation plan is used for various tasks:

  • Add generation tasks for file objects that are already contained in a plan (command IN).

  • Display external object (command DI).

  • Specify which generation options are to be used (commands OO, MO, DO).

  • Display messages of generation functions called from the plan (command SM).

  • Determine that a generation task is to be executed again (command RE).

  • Delete generation tasks from plan (command UN).

Execute an Implementation Plan

The function Execute implementation plan processes all generation tasks with status no or reexecute.

Depending on the result of a generation function, the generation status of the tasks is changed. All messages of the generation function are stored and can be displayed with command SM of the function Modify implementation plan.

Reexecute an Implementation Plan

The function Reexecute implementation plan changes the status of all tasks which could be reset to status reexecute manually, to reexecute and then starts the execution of the implementation plan.

Administrate an Implementation Plan

Implementation plans can be renamed, copied, displayed, purged, and selected from a list.

Executing Implementation Plans under Adabas Vista

If an implementation plan contains a generation task for an Adabas file, ADAINV cards, a DDM or Vista translation tables, the virtual machine and the network that were current when adding the task(s) to the plan are stored with the plan.

Such an implementation plan can be modified/extended/executed only if the current virtual machine/network and the virtual machine/network that are stored with the plan are identical.

Generating a DDM under Natural Security

If you use an implementation plan to generate a DDM that is protected by Natural Security, the task is set to mis (valid generation options missing) because a countersignature is required. The function MO (modify generation options) must be performed and a countersignature entered.

If the Predict file object and the Natural Security definition have not been modified since countersigning the task, the generate DDM function will then be performed when the implementation plan is executed.

If either the Predict file object or the Natural Security definition has been modified since countersigning, the generation task will be skipped.

Calling File Implementation Functions

The File Implementation Menu

File implementation functions are called from the File Implementation Menu, which is called with function code F from any Predict main menu or with the command IMPLEMENT FILE.

    13:13:01             *****  P R E D I C T  *****             2007-05-31
    Plan  10                - File Implementation Menu -               Profile HNO
   
   
     Function                           Function
   
     A  Add an implementation plan      D  Display implementation plan
     C  Copy implementation plan        E  Extend implementation plan
     M  Modify implementation plan      S  Select implementation plan from list
     N  Rename implementation plan      X  Execute implementation plan
     P  Purge implementation plan       R  Reexecute implementation plan
   
   
   
    Function .................
   
    Implementation plan ID ...
    Copy ID ..................
   
   
    Command ===>
    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
   

Parameters
Function Select function code from menu.
Implementation Plan ID ID of implementation plan to be processed. Up to 12 alphanumeric characters and starting with a letter.
Copy ID For Copy implementation plan function: ID of new implementation plan to be created. Up to 12 alphanumeric characters and starting with a letter.

Executing and Displaying an Implementation Plan in Batch Mode

Implementation plans can be executed, reexecuted and displayed in batch mode. Enter command IMPLEMENT FILE, and on the next line the required parameters in positional or keyword form.

Field Keyword Position
Function FUNCTION 1
Plan ID PLAN-ID 2

Example Batch

To execute and list the implementation plan IMP-TEST use the commands:

IMPLEMENT FILE
FUNCTION=X,PLAN-ID=IMP-TEST
IMPLEMENT FILE
D,IMP-TEST

Handling of Errors in Batch Mode

Condition Code 106 is issued if

  • a function in the implementation plan is executed with errors,

  • or a function terminates abnormally,

  • or the plan contains at least one generation task that failed or could not be executed (status impossible).

File Implementation Functions

Add Implementation Plan - Code A

Implementation plans are created with the Add implementation plan function by specifying an Implementation Plan ID in the File Implementation Menu and - in the subsequent Add Implementation Plan screen - a combination of Predict selection criteria and generation functions. Invalid combinations of file object and generation function are not added to the implementation plan.

Generation tasks are added for each file that meets the given selection criteria according to the following rules:

  • for each valid combination of file object and generation function, one generation task is added (if no external object for the file exists)

  • if external objects for a file already exist, one generation task is added for each external object. This facilitates regenerating existing external objects.

Note:
For Adabas files, DDMs, ADAINV cards and Vista translation tables, tasks are added only for those external objects that are accessible in the current virtual machine/network.

The plan is displayed and the tasks can be modified with the same functions that are provided in the Modify Implementation Plan screen.

    13:13:17             *****  P R E D I C T  *****             2007-05-31
                             - Add Implementation Plan -                Profile HNO
    Implementation plan ID .. HNO-PLAN1            Added 2007-05-31 at 13:12 by HNO
                                                Modified
                                                Executed
   
    File ID ........... 
    Files of type ....*    File number ...
    Contained in DA ...
   
    Implemented ....... N (Y,N)
    Modified .......... N (Y,N)
    with userviews .... N (Y,N)   Restrictions .....*   Profile HNO ,used
   
    ----------------------- Generation functions --------------------------------
    ADACMP/ADAWAN .........   Adabas file ...........   ADAINV cards ..........  
    ADASCR ................   Adabas - VSAM .........   DB2 table/view ........  
    SQL CREATE Stmnt ......   DDM for Natural .......   OS/400 File Def. ......  
    BAL/ASSEMBLER .........   Language C ............   COBOL .................  
    FORTRAN ...............   PL/1 ..................                            
   
    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
   

Parameters
Implementation plan ID ID of the plan. A read-only field.
Added Date and time the plan was added.
Modified Date and time the plan was last modified.
Executed For function Extend implementation plan: Date and time the plan was executed last. Date and time are taken when executing the last task in the plan. Not applicable for function Add implementation plan.
File ID ID of the file(s) for which generation tasks are to be included in the plan. Use asterisk notation to select a range of files. If a unique file ID is specified, all other selection criteria are ignored.
Files of type Only files of this type are added to the plan.
File number Only files with this number are added to the plan.
Contained in DA Only files in the specified database(s) are added to the plan.
Implemented
Y A generation task will be included in the plan only for Predict file objects for which implemented external objects exist for the respective generation function. Each generation task will therefore replace an external object.
Modified
Y A generation task will be included in the plan only for Predict objects marked modified after generation. Each generation task will therefore replace an external object if the Predict object has been changed since generation.
with userviews
Y

The selection criteria will apply to master files only. If userviews are derived from the Predict file objects, generation tasks for these userviews are automatically included into the implementation plan.

For files of type AT (Adabas cluster table), only one file is entered in the plan. The generation task automatically generates a cluster description for each file in the cluster.

Restrictions See Restrictions in the section Predict User Interface in the Introduction to Predict documentation.
Generation functions Mark with any non-blank character the external object(s) to be created for each file selected.

Copy Implementation Plan - Code C

Copies the plan Implementation Plan ID to Copy ID. The IDs are entered in the File Implementation Menu.

Modify Implementation Plan - Code M

Generation tasks in an implementation plan can be changed with several functions. If a task is modified, its generation status (indicated in the column Generation) is changed to reexecute if it had already been executed.

Note:
Plans containing a generation task for an Adabas file, ADAINV cards, a DDM or Vista translation tables can only be modified if the current virtual machine/network and the virtual machine/network that are stored with the plan are identical. It is however possible to purge a plan regardless of the current virtual machine/network.

    13:19:18            *****  P R E D I C T  *****             2007-05-31
                            - Modify Implementation Plan -
   
       Implementation plan ID .. CHD-FDT
   
       F  Language         Dbnr  Fnr   Library  Member   Op.-mem. Opt Generation
   
       __ --- FILE-ID: CHD-FDT
       __ ADACMP/ADAWAN      188    57 WANLIB   CHD-FDT1          old performed
       __ ADABAS file        188    57 WANLIB   CHD-FDT1          mod abended
       __                    181    57                            mod executing
       __                    180    57                            mod warning
       __                    205    57                            mis impossible
       __
       __
       __
       __
       __
       __
       __
       __
   
       __ ( '.' = EXIT , 'T' = TOP )
   
   

Meaning of Columns
F
Two-letter command processing the generation task.
IN Insert new task for the file object with the same language. The task is inserted after current task. Different generation options can be used.
DI Display external object.
DO Use default options. The external object will be generated with the options defined in the Modify ... Defaults screen.
OO Use old generation options for generation.
MO Modify generation options. The respective generation screen is displayed. File ID, Overwrite option and List generated code cannot be modified and Member and Library cannot be changed if the external object already exists.
SM Show messages that the generation function issued when the generation task was executed last.
RE Reexecute a generation task that was executed successfully or which terminated abnormally.
UN Undo generation task (delete from list).

Note:
Which functions can be applied to a generation task depends on several factors, such as type of generation function and whether the generation task has already been executed. Enter an asterisk in the column F to show valid functions for a specific generation task.

Language The type of external object to be generated, for example: COBOL when generating COBOL copy code.
Dbnr / Fnr Database number / file number of the external object (if applicable).
Library / Member Member and library of the external object (if applicable).
Op.-mem. See description of parameters Save as member, Save in library and Op. sys member in the section Parameters Specifying the Form of Output.
Opt
Shows which generation options are used:
def Execute task using default generation options. See the section Defaults in the Predict Administration documentation.
mis No valid generation options are available. The function MO (modify generation options) must be performed for the generation task before it can be executed.
old Execute task using generation options that were used when the member was generated last.
mod Execute task using modified generation options. This value appears if the command MO has been issued for a generation task (even if no options were in fact changed).
Generation
Status of the generation tasks:
abended Task terminated abnormally.
errorTask performed with errors. See also Error Handling - Online.
executing Task is executing or terminated abnormally.
impossible Task could not be performed, for example because the generation options are missing or because you are not authorized to generate the DDM. This status can be reset with the command MO (modify generation options). See above.
interrupted Task interrupted by the user.
no Task not yet performed.
performed Task performed successfully.
reexecute Task will be performed again.
sav.error Task performed with errors; the generated code was saved.
warning Task performed with warnings.

Rename Implementation Plan - Code N

After calling the function Rename implementation plan, a screen appears for entering a new Implementation Plan ID.

Purge Implementation Plan - Code P

Additional confirmation is requested before a plan is actually purged. The implementation plan will be purged if you enter DELETE.

Display Implementation Plan - Code D

The function Display implementation plan displays a plan as shown below:

    13:42:18             *****  P R E D I C T  *****                       2007-05-31
                          - Display Implementation Plan -
                                                    Added 2007-05-31 at 13:01 by CHD
                                                 Modified
                                                 Executed 2007-05-31 at 13:05
    Implementation plan ID .. TEST
    Network .................
    Virtual machine .........
    -------------------------------------------------------------------------------
         Language        DBnr   Fnr Library  Member   Op.-mem. Option   Generation
   
    File ID ...... CHD-CIPHER
      Language C                                               old      warning
           DIC1800 SUMMARY:     4 FIELD(S) PROCESSED
           DIC1818 WARNING:     1 FORMAT(S) CHANGED
      COBOL                                                    old      performed
           DIC1800 SUMMARY:     4 FIELD(S) PROCESSED
   
    File ID ...... CHD-COBOL-PREF-G
      Language C                                               old      performed
    Command ===>                                                    Scroll ==> CSR
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
                      Quit        RFind Flip  -     +           Left  Right
                                                   line 1 of 47 (line 10 on screen)
   

Information Given by Display Implementation Plan

The function Display Implementation Plan gives the following information:

  • Information as contained in the Add/Extend/Modify Implementation Plan screens.

  • If a plan contains a generation task for an Adabas file, ADAINV cards, a DDM or Vista translation tables, the virtual machine/network combination that is stored with the plan is displayed. If the current virtual machine/network combination differs from the one that is stored with the plan, a warning is issued.

  • Warnings and error messages issued by generation functions are displayed if the generation function was executed from the plan.

Note:
Display Implementation Plan can be executed in batch mode. See Executing and Displaying an Implementation Plan in Batch Mode.

Extend Implementation Plan - Code E

This function is used to add generation tasks for file objects that are not yet contained in the implementation plan. The function Extend implementation plan uses the same input screens as Add Implementation Plan.

Note:
New generation tasks for file object/generation function combinations that are already contained in a plan can be added with the command IN of the function Modify implementation plan.

Select Implementation Plan from List - Code S

Implementation plans can be selected for further processing. Enter function code S in the File Implementation Menu and

  • leave field Plan ID blank to display all plans for selection or

  • enter a plan ID ending with an asterisk to specify a range of values.

The Implementation Plan Selection screen will appear:

   13:48:24             *****  P R E D I C T  *****             2007-05-31
                         - Implementation Plan Selection -
   
     M  Impl. plan ID   Last modification   Exec. Date          Remarks
   
     _  CHD            2004-07-30 at 13:59 2004-07-12 at 13:55   mod. after exec.
     _  CHD-A-FDT      2004-07-03 at 13:48 2004-07-03 at 13:50
     _  CHD-ABC        2004-07-03 at 13:25 2004-07-03 at 13:25   mod. after exec.
     _  CHD-COPY2      2004-07-12 at 13:38 2004-07-12 at 13:41
     _  CHD-FDT        2004-07-12 at 13:57 2004-07-03 at 13:14
     _  CHD-FDT2       2004-07-03 at 13:15
     _  CHD-NET        2004-07-07 at 18:09
     _  CHD-TRUNC      2004-07-03 at 13:03 2004-07-03 at 13:03   mod. after exec.
     _  CHDA           2004-07-02 at 13:04 2004-07-02 at 13:05
     _  CHDABC         2004-07-02 at 13:22 2004-07-02 at 13:22
     _  CHDAN          2004-07-08 at 13:47 2004-07-08 at 13:47
     _  CHDB           2004-07-02 at 19:01
     _  CHDBA          2004-07-06 at 09:54 2004-07-06 at 09:55
     _  CHDBBB         2004-07-12 at 18:27
     _  CHDC           2004-07-05 at 13:12                       currently modified
     _  CHDCOB         2004-07-12 at 13:03 2004-07-12 at 13:03
   
     _  ('.' = EXIT , 'T' = TOP )
   
   

The following information is displayed:

  • implementation plan ID

  • date and time of last modification

  • execution date and time

  • remarks (see below)

Enter a non-blank character in column M to select a plan for further processing.

Remarks
The following remarks are possible:
currently modified Another user is currently modifying this implementation plan or the last attempt to modify the plan terminated abnormally.
mod. after exec. The implementation plan has been modified since it was last executed.
executing The plan is currently executing or the execution of the implementation plan terminated abnormally.

Execute Implementation Plan - Code X

The function Execute Implementation Plan can also be executed in batch mode. See Executing and Displaying an Implementation Plan in Batch Mode.

Note:
Plans containing a generation task for an Adabas file, ADAINV cards, a DDM or Vista translation tables can only be executed if the current virtual machine/network combination and the virtual machine/network combination stored with the plan are identical.

    09:57:05             *****  P R E D I C T  *****             2007-05-31
    Plan   0                - File Implementation Menu -                Profile HNO
   
   
     Function                           Function
   
     A  Add an implementation plan      D  Display implementation plan
     C  Copy implementation plan        E  Extend implementation plan
     M  Modify implementation plan      S  Select implementation plan from list
     N  Rename implementation plan      X  Execute implementation plan
     P  Purge implementation plan       R  Reexecute implementation plan
      +----------------------------------------------+
      !                                              !
      !      File Implementation performed for       !
    F !                                              !
      ! File ID ... CHD-COND                         !
    I ! Language .. Language C                       !
    C ! Library ... CCCLIB      Member ....          !
      ! DBnr ......             File nr ...          !
      !                                              !
    C +----------------------------------------------+
    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
   
   

When an Implementation Plan is executed, all generation tasks of status no or reexecute are executed. All other generation tasks are skipped. The task currently being executed is displayed in a window (see screen above). If the plan does not contain any executable task (status no or reexecute), a corresponding message is given.

You can repeat the execution of a plan if necessary (for example due to abnormal termination or system errors).

Reexecute Implementation Plan - Code R

This function consists of two parts:

  • Tasks are set to status reexecute
    All tasks in the implementation plan for which the command RE could be entered when executing the function Modify Plan are set to reexecute. The command RE is valid for all tasks that have been started at least once, i.e. in one of the following statuses: abended, error, executing, interrupted, performed, sav. error, or warning. If a task is set to reexecute, any messages that were issued during the last generation are removed from the plan. Generate DDM tasks are set to impossible if Natural Security is installed and a countersignature is required.

  • Function Execute plan is started
    In the second step, the function Execute Plan is started. If the execution terminates for any reason, the function Execute Plan can be started again at a later time to process the tasks that could not be executed.

Reexecute Implementation Plan in Batch Mode

This function can also be executed in batch mode. See Executing and Displaying an Implementation Plan in Batch Mode.

Error Handling - Online

If parameters of a generation task cannot be applied, a message is returned and in some cases a selection window. Select a valid value from this window to execute the task.

A generation task that cannot be executed due to errors is given the status error. The status can be set to reexecute with the function RE or by modifying the generation options.

If a generation task terminates abnormally (status abended or executing), call the generation function directly to get a detailed error message (DICnnnn).