Skip to main content  
        iSeries home   |   Easy400  
Public-Source
 
 
 
Introduction
About it
Prerequisites
Installation
 Creating a repository
Using a repository
An example
 
 Download
 
 

 
PLCHECKUP
Creating a repository

1-Repositories

A PLCheckUp application repository is a set of database files containing information related to an application. This information is created via command PLCHECKUP and displayed via command PLCHECK.
It would not be appropriate to have the database file repository be generated in a user library. As a rule, therefore, each application repository should reside in a dedicated library.
Each repository should be dedicated to a single program library.
Repository libraries can be deleted as soon as they are no longer needed. Repositories can be re-created at any time.

2-Some special requirements

A PLCHECKUP repository, among many other functions, provides the ability to find out which program modules use (import) a given service program procedure. This is useful when you plan to change the parameters of some service program procedure, inasmuch this feature allows you to know which modules/programs should be updated.
However, the system API providing information about imported procedures does not work on programs, it works on program modules.
Unluckily, when you create a (RPG/CLLE/etc.) bound program, its program module is temporarily created in library QTEMP and is later on deleted.
This is why PLCHECKUP tries to recreate all modules (and subsequently all programs) in its repository library. This requires that

  • program (module) sources are available
  • the correct library list for compiles is provided through a PLCHECKUP command parameter.
After trying to recreate all modules, if anyone failed, command PLCHECKUP will show you a list of the failed once and let you try to re-create them by yourself.
In the next step, command PLCHECKUP tries to create (in the repository library) all the original programs, starting from their modules and it will provide you, if needed, a list of the failed ones.
However, you should not be extremely concerned is some modules and programs failed to be created. After all, the only thing that you will be missing is some information about the service propgram procedures used (imported) by those modules. All the other PLCHECKUP repository feature would still work.

3-Creating a repository

After creating a library to contain an application repository, you must enable this library to contain a repository.
This enablement is necessary to prevent creation of a repository in the wrong library. In fact, once one realizes to have mentioned the wrong library, would have soon or later to remove from it the repository database files, and this activity is prone to painful errors.

To enable a library as repository, run command PLCHECKUP/ALWLIB:
               Allow PLCHECKUP repository (ALWLIB) 
                                                          
Type choices, press Enter.                                
                                                          
Repository library . . . . . . . LIB                  Name     
Allow  . . . . . . . . . . . . . ALLOW  *YES          *YES, *NO
Figure 1 - Command PLCHECKUP/ALWLIB

Next, to create a repository, enter command PLCHECKUP/PLCHECKUP and press F4 to prompt it.

You are first displayed the initial key parameter FROMLIB:
                    Run Program Library Check Up (PLCHECKUP)                  
                                                                              
 Type choices, press Enter.                                                   
                                                                              
 From library . . . . . . . . . . FROMLIB                   Name                           

Figure 2a - Command PLCHECKUP/PLCHECKUP

Key parameter:

  • fromlib - This is the name of the library containing the application programs to be documented in a repository.
    You should enter this library name and press Enter.
    • If the current user profile already ran command PLCHECKUP for this application program library, command PLCHECKUP retrieves the parameters used to create it.
    • If the current user profile never ran before command PLCHECKUP for this application program library, command PLCHECKUP will show up parameters as displayed in Figure 2b.

                    Run Program Library Check Up (PLCHECKUP)                    
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 From library . . . . . . . . . . FROMLIB                   Name                          
 To library . . . . . . . . . . . TOLIB                     Name                          
 Work library list  . . . . . . . WRKLIBL                                                 
                                                                                          
                                                                                          
                                                                                          
                                                                                          
                                                                                          
 Program(s) to be selected  . . . PGM         *ALL          Name, generic*, *ALL          
 To source file . . . . . . . . . TOSRCF      QCLSRC        Name                          
 To 'Create modules' src member   TOMODSRCM   CRTMODS       Name                          
 To 'Create pgms' src member  . . TOPGMSRCM   CRTPGMS       Name, *NONE                   
 Run command PLCHECK  . . . . . . PLCHECK     *YES          *YES, *NO                     

Figure 2b - Command PLCHECKUP/PLCHECKUP

Command parameters:

  • fromlib - This is the name of the library containing the application programs. Related service programs, files and other objects used by these programs can reside in any library. The contents of this library will not be modified.
  • tolib - This is the name of the library that should contain the repository. This library should be a dedicated library and must have been enabled to such a scope by command PLCHECKUP/ALWLIB (see Figure 1).
  • wrklibl - As explained further on, all modules making up the programs in library fromlib will be temporarily re-created in library tolib. In order to make this happen, all the libraries needed to re-create these program modules must be specified (in the appropriate order) in this parameter. Usually these libraries are the ones containing database files and (if bound through a library list) service programs. Source libraries do not need to be specified.
  • pgm - You may request to process all the programs in library fromlib, or just a subset of them by specifying a program generic name.
  • tosrcf - In order to detect the names of the external (service program) subprocedures used by each module, program modules must be examined. Problem is, however, that most of the times program modules no longer exist, as they may have been temporarily created in library QTEMP (this happens for instance, when command CRTBNDRPG was used to create a program).
    Due to this, command PLCHECKUP tries to temporarily re-create modules in library tolib.
    This is done by generating an ILE CL source, compiling and running it.
    This source, along with the one optionally generated to create programs, maybe of some interest for developers. They could, for instance, copy and customize these sources so to make up a program regeneration procedure.
    This is why you have to specify the name of a source file (in library tolib) where these sources can be generated. You do not have to create such a source file, it will be done by command PLCHECKUP itself.
  • tomodsrcm - Enter the name of the source member that is to contain the ILE CL source for regenerating modules in library tolib.
  • topgmsrcm - A temporary regeneration of programs in library tolib is not needed by the repository.
    However, if request so, and specify a member name other than *NONE, such a source is generated for developers' convenience. This source will be compiled and run to check out for errors.
  • plcheck - PLCHECK is the command that allows to work with a repository.
    You may ask this command to be executed as soon as the repository is complete.

    Notes on PLCHECKUP command execution:

    1. Should some program modules fail to be temporarily re-created in library tolib, you would be displayed a list of such modules.
      You are then allowed to go for correcting actions, such as
      • changing the job library list
      • updating module sources
      • submitting re-compile jobs
    2. Should some programs fail to be temporarily re-created in library tolib, you would be displayed a list of such programs.
      This event has no impact at all on the repository. You should just review -if you care to copy it- the source used to regenerate programs.

    4-Command PLCHECK

    Any time you want to work with an existing PLCHECKUP repository, use command PLCHECKUP/PLCHECK (do not use command PLCHECKUP/PLCHECKUP, you do not need to rebuild the repository).
               Work with PLCHECKUP repository (PLCHECK) 
                                                                 
     Type choices, press Enter.                                  
                                                                 
     Repository library . . . . . . .                Name       
                                                                
    
    Figure 2b - Command PLCHECKUP/PLCHECK

    5-Updating a repository

    The information stored in a repository is static, that is it does not reflect changes that may occur in your application program library.

    In order to update a repository, you may rerun command PLCHECKUP/PLCHECKUP with the same parameters you used to originally create that repository, or you can use command PLCHECKUP/PLADDPGM.

    Command PLADDPGM lets you update a repository with information related to new or changed programs.
    Enter command PLCHECKUP/PLADDPGM and press F4 to prompt it.

    You are first displayed the initial key parameter FROMLIB:
                       Work with PLCHECKUP repository (PLCHECK)
                                                               
    Type choices, press Enter.                                 
                                                               
    Repository library . . . . . . .                Name      
                                                                                                                        
    
    Figure 3a - Command PLCHECKUP/PLADDPGM

    Enter the name of your application program library and press the Enter key. You are then displayed the parameter that you used to create the repository for this program library.
    In the following picture, the application program library was CGIWRKDBF and the name of the library containing the repository was WORK:
                        Add program(s) to a repository (PLADDPGM)                   
                                                                                    
     Type choices, press Enter.                                                     
                                                                                    
     From library . . . . . . . . . .>FROMLIB     CGIWRKDBF     Name                          
     To library . . . . . . . . . . . TOLIB       WORK          Name                          
     Work library list  . . . . . . . WRKLIBL     'CGIWRKDBF LIBHTTP'                         
                                                                                              
                                                                                              
                                                                                              
                                                                                              
                                                                                              
     Program(s) to be added . . . . . PGM                       Name, generic*, *ALL
     Run command PLCHECK  . . . . . . PLCHECK     *YES          *YES, *NO                     
                                                                                    
                                                               
    
    Figure 3b - Command PLCHECKUP/PLADDPGM

    Last, in parameter PGM enter a program name, a generic program name or *ALL, and the repository update starts performing.

    Notes on PLADDPGM command execution:

    1. Should some program modules fail to be temporarily re-created in library tolib, you would be displayed a list of such modules.
      You are then allowed to go for correcting actions, such as
      • changing the job library list
      • updating module sources
      • submitting re-compile jobs
    2. This time no program re-generation takes place.
    3. The CL sources previously generated from command PLCHECKUP (see parameters TOSRCF, TOMODSRCM and TOPGMSRC) are not changed by command PLADDPGM.

    5-Exit points

    Some exit points are available for command PLCHECKUP.
    You may define which exit points should pass control to user programs during PLCHECKUP processing.
    Use command PLCHECKUP/WRKEXITP to you define your exit point programs.

    The following is a list of the available exit points:

    1. Exit point RTVPGMMODS
      PLCHECKUP needs to temporarily re-create the modules making up an ILE program. In order to accomplish this job, it retrieves information about the source members originating the program modules. If a source member is not found on the system, PLCHECKUP calls a user-specified exit program for exit point RTVPGMMODS to retrieve such information.
      The following are the parameters passed to the user-specified exit-program:
      1-Program namechar 10
      2-Program library namechar 10
      3-Module namechar 10
      4-Module library namechar 10
      5-Module source file namechar 10
      6-Module source file library namechar 10
      7-Module source file member namechar 10
      The user program should return the appropriate information in parameters:
      5-Module source file name
      6-Module source file library name
      7-Module source file member name

    6-Using a repository

    See the next page.