Page tree
Skip to end of metadata
Go to start of metadata

On this page:

Target audience:

CAST Administrators

Summary: this page provides detailed information about CAST's support for Mainframe technologies: Cobol, JCL, IMS, CICS

Detailed technology support

Language versionSupportedComments

Cobol ANSI 85

(tick)

The Mainframe Analyzer is based on the Cobol 85 standard but it does not take into account all specific Cobol extensions to this standard.

Supported Cobol Extensions

  • Terminal Format
  • Pointer Variables declaration
  • Level-78 variables (Micro Focus)
  • Command mode EXEC CICS
  • Command mode EXEC SQL
  • Command mode EXEC DLI
  • Floating comments tag ("*>")
Please ensure you check the list of Cobol dialects and their level of support as listed in Mainframe - application qualification specifics in the chapter Mainframe Platforms > COBOL.

Copybook pre-processing

In addition to the standard COPY directive, the following specific directives are supported:

  • Panvalet (++INCLUDE)
  • Librarian (-INC)
  • OpenVMS (<copyDir>:<copyName>)


Replacement rules used in COPY REPLACING directives are:

  1. Replacements can be applied to words or parts of word.
  2. Patterns used to replace parts of words must be delimited by the following characters: :, (, ), \ or "
  3. Patterns that are not delimited by the above characters are considered as being used to replace entire words.
  4. LEADING and TRAILING clauses mean that the replacement will be applied on parts of words and as such, patterns must respect the rule 2 (first character and last character will be removed from the pattern).
JCL z/OS(tick) 
IMS/DB(tick)

The Mainframe Analyzer takes into account IMS/DB only (DBD, PSB, CBLTDLI calls and EXEC DLI macros). IMS/DC is not taken into account.

Non-relational mainframe DBMS other than IMS/DB are not supported (ex: DATACOM, IDMS, IDS2, DMS2, ADABAS...). However, DB2 and Oracle (ProCobol) are supported.

CICS(tick) 

Required third-party software

To successfully deliver and analyze Mainframe code, the following third-party software is required:

Install on workstation running the DMT (for extraction)
Install on workstation running CMS (for analysis)

Nothing required

Nothing required

Mainframe objects and links

The following section lists the objects and links between objects that the Mainframe analyzer is capable of detecting and storing in the CAST Analysis Service:

Objects

Cobol

Program

Copy Book

Paragraph

Section

Division

File Link

Data Link

Class

Directory/Root Directory

Entry Point

Interface

Program Specification Block

Database Definition

IMS Segment

Cobol conditional test

Cobol data

Cobol literal, Cobol structure data, Cobol constant data

External File

Transaction

Screen Map

Transient Data

Project

Cobol Subset

JCL

Catalogued Job

Catalogued Procedure

Step

Instream Procedure

Dataset

External Program

Included File

Index

Project

Directory/Root Directory

Program Specification Block

JCL Subset

IMS

Directory/Root Directory

IMS Database

IMS Field

IMS Alternate PC Block

IMS PC Block type Database

IMS PC Block type GSAM

IMS Project

IMS PS Block

IMS Segment

IMS GSAM File

IMS Subset

CICS

CICS Basic Mapping Support

CICS System Definition file

CICS System Definition group

CICS Dataset

Directory/Root Directory

CICS Map

CICS Mapset

CICS Project

CICS TD Queue

CICS Transaction

CICS TS Model

Cobol

Link TypeLinked ObjectsCode Example
CallingCalled
CALLPROG*Program, section or copybookProgram or entrypointCALL "CC2DISPLAY"
TRANSAC*EXEC CICS XCTL
PROGRAM(TEST)
END EXEC
PERFORMProgram, section or sub-objectSection or paragraphMODULE-ENTREE SECTION.
*
* LA LIGNE CI DESSOUS DOIT ETRE DELETEE APRES LES TESTS
*
MOVE '*** EXECUTION STARTEE NORMALEMENT ***' TO MESS.
DISPLAY MESS.
MOVE SPACE TO MESS.
*
PERFORM LECTURE-PARAM.
*
FIN-MODULE-ENTREE. EXIT.
EJECT
*
COPY SYBPINIT.
GOTOProgramFirst executed section or paragraph****************
LECTURE-PARAM SECTION.
****************
*
READ MEF001.
IF FILE-STATUS NOT = '00'
DISPLAY 'CODE RETOUR' FILE-STATUS
DISPLAY 'CARTE PARAMETRE INEXISTANTE : ' CODE-ABEND
GO TO SORTIE-ERREUR
END-IF.
*

SectionFirst executed paragraph in section
ParagraphNext executed paragraph in same section
-Section/ParagraphSection/Paragraph

When Sections or Paragraphs are sequentially executed (one after the other) a Call link will be generated. For example, if a program is made of Section A then Section B then Paragraph C then Section D, the links will be resolved as A -> B -> C -> D.

INCLUDEProgram or CopybookCopybook* -ACDA * MNPW * * * * * * * * * * * * * * * * * * * * * * * * *
* FD DU FICHIER INF103 PAR LE CHEMIN INF103
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
BLOCK CONTAINS 0.
*
COPY INF103 REPLACING INF103 BY ING103.
USECalls to matched character stringsDisplay "a string"
  • Cobol Program
  • Cobol Section
  • Cobol Paragraph
Program Specification BlockEXEC DLI SCH PSB (MYPSB) END-EXEC
ACCESSOPEN
  • Cobol Program or sub-object
  • Cobol File Link
  • Cobol Data Link
*======================================================== * OUVERTURE DU FICHIER IAHCDECE *======================================================== OPEN-IAHCDECE.
OPEN INPUT IAHCDECE. *======================================================== * LECTURES DU FICHIER IAHCDECE *======================================================== LECT-IAHCDECE.
READ IAHCDECE
. *======================================================== * FERMETURE DU FICHIER IAHCDECE *======================================================== CLOSE-IAHCDECE.
CLOSE IAHCDECE.
 

*======================================================== * LECTURE-SEGMENT-CISRAPMP *========================================================
EXEC DLI
GU
USING
PCB (3)
SEGMENT (CISRAPMP)
WHERE (CIOEAX = IN-PREM-H)
INTO (WS-DUMMY-AREA)
END-EXEC.
 

*========================================================
COMMANDE-CALL-LEVEL
*========================================================
CALL 'CBLTDLI' USING GU
CICSDLI-PCB
CICSDLI-SEGM
CICSDLI-QSSA

CLOSE
READ
  • Cobol Program or sub-object
  • Cobol Section
  • Cobol Paragraph
  • Cobol File Link
  • Cobol Data Link
  • Constant Data
  • Structured Data
  • Data
  • Conditional Test
  • Program Communication Block
    (IMS PCB)
  • IMS Segment
WRITE

For Embedded SQL links, the following are valid for all servers.

USESELECTThis type is reserved for server side object referencingEXEC SQL... SELECT
UPDATEEXEC SQL... UPDATE
INSERTEXEC SQL... INSERT
DELETEEXEC SQL... DELETE
CALLEXEC SQL... CAL

For link types CALL PROG and CALL TRANSAC, two limitations exist when the call is in "string" form:

  • If the string is constant and declared in the "data-division" section, the entry point will be resolved in the normal way.
  • If the string is dynamic, the program may be found by the Dynamic Link Manager.

In addition, the following Embedded SQL links are valid for DB2 only:

DEPEND ONThis type is reserved for server side object referencing on structured or distinct UDTs.-
DDLCREATEThis type is reserved for server side object referencing on Tables-
DDLDROP

JCL

TypeLinked Objects
CallingCalled
ACCESSWRITEJCL StepJCL Data Set
READ
EXECUTE
PROTOTYPECobol File LinkJCL Data Set
Cobol Data LinkJCL Data Set
JCL Data SetCobol JCL Program
CALLJCL StepCobol JCL Program
JCL JobJCL Step
JCL ProcedureJCL Step
JCL StepJCL Procedure
USEJCL StepIMS DBD
MONITORAFTERJCL StepJCL Step

IMS

TypeLinked Objects
CallingCalled
ACCESSWRITEIMS PC BlockIMS Segment
USEIMS PC BlockIMS DBD or IMS GSAM File

CICS

TypeLinked Objects
CallingCalled
CALLTRANSACCICS TransidClient/Cobol Program

For Transactional Code, the following are valid:

TypeLinked ObjectsWhen does this link occur?
CallingCalled
CALLTRANSACClient/Cobol Program or its Sub objectClient/Cobol Program

EXEC CICS XCTL
PROGRAM(TEST)
END EXEC

or

EXEC CICS LINK
PROGRAM(TEST)
END EXEC

CALLTRANSACClient/Cobol Program or its Sub objectCICS Transaction

EXEC CICS START
TRANSID(TRANSID)
END EXEC

or

EXEC CICS RETURN
TRANSID (W-XFR-CTRS)
COMMAREA (W-CIC-CMA-LDON)
LENGTH (W-CIC-CMA-QLENDON)
END-EXEC

MONITORClient/Cobol Program or its Sub objectCICS MapEXEC CICS
SEND MAP (W-CIC-CMAPCUR)
MAPSET (W-CIC-CMPSCUR)
FROM (MGAB10O)
ERASE
FREEKB
FRSET
CURSOR
END-EXEC

or

EXEC CICS
RECEIVE MAP (W-CIC-CMAPCUR)
MAPSET (W-CIC-CMPSCUR)
FROM (MGAB10O)
END-EXEC

ACCESSOPEN

CLOSE

READ

WRITE

Client/Cobol Program or its Sub objectCICS DatasetENDBR, DELETE,
LINK, READ, READNEXT,
READPREV, REWRITE,
STARTBR, XCTL,
WRITE

ex:

EXEC CICS
READ DATASET ('C1MASTR')
INTO (BLKBLK(BLKBLK-OCUR))
RIDFLD (CICS-RRN) RRN
RESP (WS-RESP) END-EXEC.

READ

WRITE

Client/Cobol Program or its Sub objectCICS Transient DataDELETEQ, READQ, WRITEQ

ex:

EXEC CICS DELETEQ TD QUEUE (W-CIC-TSQ-LNOM)

Notes

The following section lists technical and functional aspects with regard to analysis of Mainframe source code:

File Management

  • The analyzer handles programs in PC file type format. However, in Mainframe, the structure of file/folder trees is not managed in the same way.
  • The notion "Library" is not taken into account.
  • When program names are identical, these programs may be ignored or may be incorrectly resolved.

Resolution

Inference Engine

The Inference Engine is implemented for the Mainframe Analyzer, but does have some limitations:

  • Renaming (66) is not supported.
  • Indexation of arrays, i.e.: the instructions MOVE with (position:length) is not supported
  • The length of a variable when given by a constant (declared as 78 - Microfocus) is not supported.
  • The Inference Engine will remain local to each program.

EXHIBIT Instruction

No links are created to variables handled by the instructions EXHIBIT.

Embedded SQL for Oracle Users

Calls to tables, views, synonyms, procedures, functions, sub-functions and package sub-procedures are all resolved. Calls to any other SQL object are not.

Analysis of Copybooks / Option "Save Copybook Structure"

  • A Copybook is analyzed implicitly when analyzing the Cobol program including it. You just have to make sure that the copybook is contained in one of the Working Folders defined in the Analysis Unit / Application. However, if you want to save the data structure located under a copybook, you need to activate the option "Save data found in copy books". Please be aware that in this case the copybook will be analyzed without performing any text replacements.

  • Copybooks containing characters that are not authorized in Cobol identifiers can cause issues if they have been selected in the Cobol page and if the "Save Copybook Structure" option has been selected. This limitation occurs when a copybook is included via the COPY REPLACING statement and if it contains replacement patterns such as '&-' (including the quote characters). In this specific case, the Cobol analyzer cannot extract the Cobol identifier correctly and so it cannot create the corresponding data structure object. However, the Cobol analyzer expands the Cobol programs correctly: the replacement patterns are replaced and the expanded code is correct.

Cobol literals

If a literal is modified between two analyses and if the "Save Data Structures" option is selected then the old version of the literal is not actually removed from the knowledge base.

DSN copied from earlier DD card

The JCL analyzer can not create a link from a step to a data set if the DD card copies a DSN clause from an earlier DD card. For instance, when the following DD cards are analyzed they will not generate a link from the step to the dataset:

//STEP1 EXEC PGM=MYPROG1
//MYDD1 DD DSN=MY.DATA.SET
//MYDD2 DD DSN=*.MYDD01
//STEP2 EXEC PGM=MYPROG2
//MYDD3 DD DSN=*.STEP1.MYDD1

JCL symbols

The JCL Parser does not take into account the JCL symbols and it can not:

  • Extract the text assigned to symbols (example of symbol assignment: "// SET MYVAR=VALUE")
  • Replace them by their value (example of symbol usage: "//STEP1 EXEC PGM=&MYPGM")
  • Propagate them through the procedure calls
    • Example of calling card: "//STEP1 EXEC MYPROC, PROG=MYPROG"
    • Example of default value assignment: "//STEP1 PROC, PROG=MYPROG"

So it is possible that object names and links may not be analyzed correctly if JCL or PROC cards contain symbols.

Batch utilities using external parameter files

The JCL analyzer can parse, via the AdvancedJCL.xml file (see Mainframe - Confirm analysis configuration for more information), the information sent to programs/utilities through a *DD ** card. However, if this DD card refers to an external file via the DSN parameter, then the analyzer cannot parse this information and create the objects and links. For instance, the following JCL code is correctly analyzed:

//JCLTEST JOB (8452200000),'COBTEST',CLASS=M,MSGCLASS=P,USER=JCH
//*
//PS10 EXEC PGM=IKJEFT01,
//STEPLIB DD DSN=ENV.APPL.LOADLIB,
// DISP=(SHR,KEEP,KEEP)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
*//SYSTSIN DD **
DSN SYSTEM(DB2P)
RUN PROGRAM(COBTEST) PLAN(TESTPLAN) PARM('1')
END
//* 

And the following JCL code cannot currently be analyzed:

//JCLTEST JOB (8452200000),'COBTEST',CLASS=M,MSGCLASS=P,USER=JCH
//*
//PS10 EXEC PGM=IKJEFT01,
//STEPLIB DD DSN=ENV.APPL.LOADLIB,
// DISP=(SHR,KEEP,KEEP)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DSN=ENV.APPL.PARMLIB(PARMTEST),
// DISP=(SHR,KEEP,KEEP)
//*
External parameter file PARMTEST:
DSN SYSTEM(DB2P)
RUN PROGRAM(COBTEST) PLAN(TESTPLAN) PARM('1')
END

Dynamic Call to CBLTDLI

The IMS CBLTDLI subprogram can be called by using a variable (dynamic call). If the variable is initialized in the DATA DIVISION (VALUE clause of data declaration) then the analyzer detects and manages the calls to IMS correctly. Otherwise, if the variable is only assigned in the PROCEDURE DIVISION (ie: by using a MOVE statement), then the analyzer does not detect a call to IMS.

PCB sent to subprograms via parameters

A Cobol program must be associated to a PSB in order to extract links to IMS via the PCB. If a program is not associated to a PSB but receives the PCBs via its parameters (it is generally the case for subprograms), then it is not possible to extract the links to IMS. Indeed, the Mainframe analyzer is not able to know which PSB defines the PCBs and it is not able to reconcile the PCBs. In addition, the PSB can be associated to one of the calling programs and this can send to the called program a part of its PCB list without taking into account the order defined in the PSB. Finally, the PCBs are sent via variables which can have different names in the caller and in the called programs. In conclusion, for this specific case, it is not possible to extract the links from a program to IMS.

Object sharing

It is possible to create links between objects belonging to different jobs but it is not possible to share objects between these jobs. This means that if a source file is analyzed several times in different Analysis Units, then several instances of objects will be created in the CAST Analysis Service.
In addition, copybooks referenced by programs via Working Folders in different analysis jobs will be duplicated in the CAST Analysis Service.

Cobol code containing "EXIT SECTION" statements

When analyzing Cobol source code implemented in MICRO Focus COBOL / AcuCOBOL, the "EXIT SECTION" statement will cause the Mainframe analyzer to issue the warning "Cannot find section or paragraph". To avoid this warning, replace the statement "EXIT SECTION" with its short form "EXIT".

COPY REPLACING

The Mainframe analyzer does not allow to expand several level of copybooks (e.g: a copybooks references another copybook) if at level "n" a REPLACING clause is used to change the name of a referenced copybook in a COPY directive located at a level n+1. In this specific case, these copybooks specified at level n+1 are not found.

For example, considering the 3 levels of inclusion:

  • level 1: COPY A REPLACING B BY C.
  • level 2 (copybook A): COPY B.
  • level 3 (copybook C)

The Mainframe analyzer will search for copybook B (that could be not found) and C is ignored when it will expand level 2.

Paragraphs containing termination statement

If a paragraph containing a termination statement (ex: GOBACK, STOP RUN...) is called by a PERFORM statement, then the analyzer will not draw a "Call" link between the paragraph containing the PERFORM statement and the next paragraph..

Nevertheless, there is a limitation if the termination statement is located in a conditional block (IF, EVALUATE). In this specific case, the analyzer will consider that the termination statement is always executed and the "Call" link between the paragraph containing the PERFORM statement and the next paragraph will not be drawn.

Example 1:

 

PARA-1.
    PERFORM PARA-TERMINATION.
PARA-2.
...
PARA-TERMINATION.
   GOBACK.

 

No "Call" link will be drawn between PARA-1 and PARA-2.

Example 2:

 

PARA-1.
    PERFORM PARA-TERMINATION.
PARA-2.
...
PARA-TERMINATION.
  IF <condition>
    GOBACK.

 

No "Call" link will be drawn between PARA-1 and PARA-2 (limitation).

This can impact the following quality rules based on paragraph calls:

  • Avoid OPEN/CLOSE inside loops
  • Avoid cyclic calls with PERFORM statements
  • Avoid unreferenced Sections and Paragraphs
  • Avoid GOTO jumps out of PERFORM range
  • No labels