Detailed technology support
Cobol ANSI 85
The Mainframe Analyzer is based on the Cobol 85 standard but it does not take into account all specific Cobol extensions to this standard.
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.
In addition to the standard COPY directive, the following specific directives are supported:
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.
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)
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:
Program Specification Block
Cobol conditional test
Cobol literal, Cobol structure data, Cobol constant data
Program Specification Block
IMS Alternate PC Block
IMS PC Block type Database
IMS PC Block type GSAM
IMS PS Block
IMS GSAM File
CICS Basic Mapping Support
CICS System Definition file
CICS System Definition group
CICS TD Queue
CICS TS Model
|Link Type||Linked Objects||Code Example|
|CALL||PROG*||Program, section or copybook||Program or entrypoint||CALL "CC2DISPLAY"|
|TRANSAC*||EXEC CICS XCTL|
|PERFORM||Program, section or sub-object||Section or paragraph||MODULE-ENTREE SECTION.|
* LA LIGNE CI DESSOUS DOIT ETRE DELETEE APRES LES TESTS
MOVE '*** EXECUTION STARTEE NORMALEMENT ***' TO MESS.
MOVE SPACE TO MESS.
|GOTO||Program||First executed section or paragraph||****************|
IF FILE-STATUS NOT = '00'
DISPLAY 'CODE RETOUR' FILE-STATUS
DISPLAY 'CARTE PARAMETRE INEXISTANTE : ' CODE-ABEND
GO TO SORTIE-ERREUR
|Section||First executed paragraph in section|
|Paragraph||Next executed paragraph in same section|
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.
|INCLUDE||Program or Copybook||Copybook||* -ACDA * MNPW * * * * * * * * * * * * * * * * * * * * * * * * *|
* FD DU FICHIER INF103 PAR LE CHEMIN INF103
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
BLOCK CONTAINS 0.
COPY INF103 REPLACING INF103 BY ING103.
|USE||Calls to matched character strings||Display "a string"|
|Program Specification Block||EXEC DLI SCH PSB (MYPSB) END-EXEC|
|ACCESS||OPEN||*======================================================== * OUVERTURE DU FICHIER IAHCDECE *======================================================== OPEN-IAHCDECE. |
OPEN INPUT IAHCDECE. *======================================================== * LECTURES DU FICHIER IAHCDECE *======================================================== LECT-IAHCDECE.
READ IAHCDECE. *======================================================== * FERMETURE DU FICHIER IAHCDECE *======================================================== CLOSE-IAHCDECE.
*======================================================== * LECTURE-SEGMENT-CISRAPMP *========================================================
For Embedded SQL links, the following are valid for all servers.
|USE||SELECT||This type is reserved for server side object referencing||EXEC SQL... SELECT|
|UPDATE||EXEC SQL... UPDATE|
|INSERT||EXEC SQL... INSERT|
|DELETE||EXEC SQL... DELETE|
|CALL||EXEC 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 ON||This type is reserved for server side object referencing on structured or distinct UDTs.||-|
|DDL||CREATE||This type is reserved for server side object referencing on Tables||-|
|ACCESS||WRITE||JCL Step||JCL Data Set|
|PROTOTYPE||Cobol File Link||JCL Data Set|
|Cobol Data Link||JCL Data Set|
|JCL Data Set||Cobol JCL Program|
|CALL||JCL Step||Cobol JCL Program|
|JCL Job||JCL Step|
|JCL Procedure||JCL Step|
|JCL Step||JCL Procedure|
|USE||JCL Step||IMS DBD|
|MONITOR||AFTER||JCL Step||JCL Step|
|ACCESS||WRITE||IMS PC Block||IMS Segment|
|USE||IMS PC Block||IMS DBD or IMS GSAM File|
|CALL||TRANSAC||CICS Transid||Client/Cobol Program|
For Transactional Code, the following are valid:
|Type||Linked Objects||When does this link occur?|
|CALL||TRANSAC||Client/Cobol Program or its Sub object||Client/Cobol Program|
EXEC CICS XCTL
EXEC CICS LINK
|CALL||TRANSAC||Client/Cobol Program or its Sub object||CICS Transaction|
EXEC CICS START
EXEC CICS RETURN
|MONITOR||Client/Cobol Program or its Sub object||CICS Map||EXEC CICS |
SEND MAP (W-CIC-CMAPCUR)
|Client/Cobol Program or its Sub object||CICS Dataset||ENDBR, DELETE,|
LINK, READ, READNEXT,
|Client/Cobol Program or its Sub object||CICS Transient Data||DELETEQ, READQ, WRITEQ|
EXEC CICS DELETEQ TD QUEUE (W-CIC-TSQ-LNOM)
The following section lists technical and functional aspects with regard to analysis of Mainframe source code:
- 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.
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.
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.
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:
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:
And the following JCL code cannot currently be analyzed:
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.
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".
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.
No "Call" link will be drawn between PARA-1 and PARA-2.
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