Cobol Advanced Configuration via XML file


It is possible to configure the Mainframe Analyzer (for Cobol) via an XML file (called Parametrization_Cobol.xml and located in the configuration\parametrization\cobol folder hierarchy within your CAST installation folder).

This file uses rules to indicate to the Mainframe Analyzer:

  • Category 1 > when to create links from subprogram calls to other objects (first category of rules)
  • Category 2 > when to deactivate Use links created via a grep search on literals used by specific statements (second category of rules)

The file will automatically be taken into account when the analysis is run.

Category 1 Rules

This category of rules enables you to tell the analyzer when to create links from subprogram calls to other objects. You can create rules for specific subprograms but you must specify:

  • the subprogram name to catch
  • how to find the target name in parameters sent to this subprogram
  • the target name to search for in the target category of objects
  • the link type to draw

Example

The following Cobol code:

       01 LAYER-REC.
           05 CALLER     PIC X(8).
           05 DATAPROC   PIC XXXX VALUE "AAAA".
           05 DATATYP    PIC X VALUE "B".
           05 TARGET-OBJ PIC X(8).
...
           MOVE "TARGET" TO TARGET-OBJ.
...
           CALL "SUBPROG" USING DATA-IN LAYER-REC RESPONSE.

can be handled by the rule:

<trigger signature="SUBPROG">
    <variables>
        <variable id="Parm2" arg="2"/>
        <variable id="target" expression="Parm2(14:8)"/>
    </variables>
    <actions>
        <addLink linkType="callLink" variable="target" filterCategory="CAST_COBOL_Program"/>
    </actions>
</trigger>

The variable "Parm2" gets the second parameter sent to the subprogram and the variable "target" gets the offset starting at position 14 in "Parm2" for 8 characters. This variable is not always necessary if the offset corresponds to the parameter.

The Mainframe Analyzer will search for objects with the name found in the variable referenced in the "variable" property (i.e.: "target") and with the type mentioned in the "filterCategory" (i.e.: "callLink") in the "addLink" element. It will create a link corresponding to the type mentioned in the "linkType" property (i.e.: "CAST_COBOL_Program").

Notes

  • If the target object is not found by the analyzer, then a prototype that will be used by the CAST Linker (a mechanism used to managed linked jobs) will be created. If the object is found, the Linker will create a link to this object. Otherwise, it will create an "unresolved object" and will create a link to this. This means that object types that can be handled by the parameterization engine must be managed by the CAST Linker (C/C++, dotNet).

Available object categories

COBOL

  • CAST_COBOL_Program: Program

CICS

  • CAST_CICS_Dataset: File
  • CAST_CICS_MapSet: Mapset
  • CAST_CICS_Map: Map
  • CAST_CICS_TDQueue: Transient Data
  • CAST_CICS_Transaction: Transaction

JCL

  • CAST_JCL_Job: Job
  • CAST_JCL_Procedure: Procedure
  • CAST_JCL_Dataset: Dataset

IMS

  • CAST_IMS_Database: Database definition (DBD)
  • CAST_IMS_Segment: Database segment
  • CAST_IMS_File: GSAM file
  • CAST_IMS_ProgramSpecificationBlock: Program Specification block (PSB)
  • CAST_IMS_ProgramControlBlock: Program control block (PCB)

RDBMS

  • SQL_TABLE: Table
  • SQL_PROC: Stored procedure
  • SQL_FUNCTION: Function
  • VIEW: View

Unsupported objects

  • CAST_Mainframe_NotHandledType: Allows the creation of a link to objects that are not supported by CAST

Available link types

  • accessLink, accessExecLink, accessReadLink, accessWriteLink, accessOpenLink, accessCloseLink
  • callLink, callProgLink, callTransacLink
  • fireLink
  • matchLink
  • monitorLink, monitorBeforeLink, monitorAfterLink
  • prototypeLink
  • raiseLink
  • referLink
  • relyonLink
  • useLink, useDeleteLink, useInsertLink, useUpdateLink, useSelectLink
Category 2 Rules

This category of rules enables you to tell the analyzer when to deactivate Use links created via a grep search on literals used by specific statements. You can define rules for specific statements and must specify:

  • the statement
  • the action to perform (forbidLink)

Example

<trigger signature="Statement.STRING">
     <actions>
        <forbidLink/>
     </actions>
</trigger>
Writing the Parametrization_Cobol.xml file

By default, the Mainframe Analyzer will search for a configuration file called Parametrization_Cobol.xml located in the \configuration\parametrization\cobol folder hierarchy within your CAST installation folder.

This file is ALWAYS taken into account when you run a Mainframe Analyzer analysis. CAST supplies this file with a set of default configuration rules already defined

Organization of rules

All rules must be placed between the <CALL_LIST> and </CALL_LIST> tags.

Errors in the XML file

Any errors in the XML file will not cause the analysis to fail, but no specific link types will be created or deactivated.

See Also

JCL Advanced Configuration via XML file


CAST Website