Summary: This document provides information about the extension providing RPG support. |
com.castsoftware.rpg
Please see RPG 3.0 - Release Notes for more information.
This extension provides support for applications written using RPG languages.
Although this extension is officially supported by CAST, please note that it has been developed within the technical constraints of the CAST Universal Analyzer technology and to some extent adapted to meet specific customer needs. Therefore the extension may not address all of the coding techniques and patterns that exist for the target technology and may not produce the same level of analysis and precision regarding e.g. quality measurement and/or function point counts that are typically produced by other CAST AIP analyzers. |
If your application contains source code written using RPG and you want to view these object types and their links with other objects, then you should install this extension.
Embedded SQL is supported, primarily to obtain Usiud links from RPG400 and CL400 objects to SQL Tables and SQL Views. The resolution of these link types requires that the database (DB2 UDB) is delivered and analyzed, however, the DB400 extractor can be used to simulate this database.
Function Points (transactions) | |
---|---|
Quality and Sizing |
CAST AIP release | Supported |
---|---|
8.3.x |
This extension is compatible with the following DBMS servers:
DBMS | Supported |
---|---|
CSS/PostgreSQL |
An installation of any compatible release of CAST AIP (see table above) |
Please see:
A set of RPG Transaction Entry/End Points, Data Entities and Excluded Items for use in the CAST Transaction Configuration Center is delivered in the extension via a .TCCSetup file. Therefore if you are using:
|
Once the extension is downloaded and installed, you can now package your source code and run an analysis. The process of preparing and delivering your source code is described below:
Before the RPG source code can be delivered and then analyzed, it needs to be collected from the proper iSeries libraries and transferred to the designated location. During this operation, each artifact (program, CL, DSPF) must be put into a single file only. This will result in a single artifact per file. Furthermore, the type of source code must be expressed using the extension to the file. The appropriate files extensions are listed in the following table.
Source code is kept in a member of a file. The file is kept in a library. Each file can have many members. Each member is the source code for a program. The source code files can have any name but conventionally the names start with Q and end with SRC, for source.
Source code type | iSeries library | Required extension | Used in MetaModel |
---|---|---|---|
RPG-III programs | QRPGSRC | *.rpg, *.rpg38 | RPG300 |
ILE RPG Programs | QRPGLESRC | *.rpgle | RPG400 |
ILE RPG Programs with SQL | QSQLRPGLESRC | *.sqlrpgle | RPG400 |
Copy source members | QCPYLESRC | *.cpyle | RPG400 |
CL programs | QCLSRC | *.cl, *.clp, *.cl38, *.clp38 | CL400 |
ILE CL Programs | QCLLESRC | *.clle | CL400 |
Display Files | QDDSSRC | *.dspf, *.dspf38 | DDS400 |
Printer Files | QDDSSRC | *.prtf, *.prtf38 | DDS400 |
Logical Files | QDBSRC | *.lf, *.lf38 | DB400/DDS400 |
Physical Files | QDBSRC | *.pf, *.pf38 | DB400/DDS400 |
Bound service programs | QBNDPGM | *.bnd | RPG400 |
Menu | QMNUSRC orQMENUSRC | *.menu | MENU |
SQL Files | *.SQL | DB400 |
RPG source code needs to be preprocessed so that CAST can understand it and analyze it correctly. In previous releases of the extension, this preprocessing was a manual action that needed to be completed before the code was analyzed. However, in this release and all future releases, the code preprocessing is actioned automatically when an analysis is launched or a snapshot is generated (the code is preprocessed before the analysis starts). In other words you only need to package, deliver and launch an analysis/generate a snapshot for the preprocessing to be completed.
RPG Analyzer provides specific pre-processors for each language embedded in this extension: the preprocessor per language only considers the files with the expected extensions.
Note that the CAST will use the LISA folder to analyze the preprocessed files. |
RPG is supported in AIP Console ≥ 1.22. |
AIP Console expects either a ZIP/archive file or source code located in a folder configured in AIP Console. You should include in the ZIP/source code folder all RPG source code. CAST highly recommends placing the files in a folder dedicated to RPG. If you are using a ZIP/archive file, zip the folders in the "temp" folder - but do not zip the "temp" folder itself, nor create any intermediary folders:
D:\temp |-----RPG |-----OtherTechno1 |-----OtherTechno2 |
The following file extensions will trigger the extractor to process the IBM Db2 for i related files correctly - so ensure that at least one of these is delivered if you have IBM Db2 for i definitions (DDS and/or DDL):
When the source code has been delivered, AIP Console will create:
Click to enlarge
Click to enlarge
Technical Size measures can be displayed for RPG analysis results in the CAST Health Dashboard by manually editing the following file:
1.x WAR file: %CATALINA_HOME%\webapps\<dashboard>\portal\resources\app.json 2.x WAR file: %CATALINA_HOME%\webapps\<dashboard>\WEB-INF\classes\config\hd\app.json 2.x ZIP file: com.castsoftware.aip.dashboard.2.0.0\config\hd\app.json |
Add the following entries into the existing section "TechnicalSizeMeasures":
"TechnicalSizeMeasures": { ... { "id": 1008000, "label": "Number of RPG400 Program(RPG400)" }, { "id": 1008001, "label": "Number of RPG400 Subroutine(RPG400)" }, { "id": 1008002, "label": "Number of RPG400 Procedure(RPG400)" }, { "id": 1008003, "label": "Number of RPG400 Copy Member(RPG400)" }, { "id": 1009000, "label": "Number of RPG300 Program(RPG300)" }, { "id": 1009001, "label": "Number of RPG300 Subroutine(RPG300)" }, { "id": 1009003, "label": "Number of RPG300 Copy Member(RPG300)" } } |
Following any changes you make, save the app.json file and then restart your application server so that the changes are taken into account.
In the Application editor > Dependencies tab, add a dependency between the Universal Analysis Unit as Source and LIB (UDB DB2 schema) as the target
During the analysis, the Universal Analyzer may throw errors or warnings. The table below lists the most significant errors/warnings and lists a suggested remediation action:
Tools | Error/Warning Message | Action |
---|---|---|
Preprocessor | File 'FileName' is empty | This is caused by source code that is referring file is empty. You can safely ignore this warning. |
Preprocessor | Unable to open file 'FullFileName' | This is caused by source code that is referring file that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | PF corresponding to the table 'tableName' was not found | This is caused by source code that is referring the Table that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | File Disk 'FDescName' not found : missing record | The record will not be created. This is caused by source code that is referring the FDescName that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | File Disk 'FDescName' not found : renamed record 'RecordName' | The record will not be created. This is caused by source code that is referring the FDescName that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | File Disk 'FDescName: renamed record 'RecordName' doesn't match the DDS record 'RecordName' | This is caused by source code that is referring the FDescName that cannot be found in the preprocessed code |
Preprocessor | Error NOMAIN in a PROGRAM | The program will not be preprocessed. Program will not be created |
Preprocessor | Copy not found 'CopyName' | This is caused by source code that is referring the called Copy that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | Missing called program='PgmName' | This is caused by source code that is referring the called program that cannot be found in the preprocessed code. You can safely ignore this warning. |
Preprocessor | Error on match if/endif at line 'LineNumber' | Object will not be created. |
Preprocessor | File does not match RPG III format (RPG IV) | This means file is not RPG III and probably is RPG IV. |
Preprocessor | File does not match RPG IV format (RPG III) | This means file is not RPG IV and probably is RPG III. |
Analyzer | Unable to find the object end for type 'RPG400Subroutine' | This is caused by source code that is referring to a SubRoutine that cannot be found. You can safely ignore this warning. |
Analyzer | Unable to find the regexp for the link 'accessLink' | The link will not be created - |
Analyzer | An unnamed object of type 'RPG400SQLStructure' has been detected | This is because RPG400SQLStructures have no specific name, as such, the CAST framework will give them the name "unnamed". You can safely ignore this warning. |
Analyzer | Duplicate object of type 'RPG400SQLStructure' has been detected: '<unnamed>' | As mentioned above, structures have no specific name and are automatically given the name "unnamed" by CAST - as such multiple objects with the name "unnamed" will exist and will cause this error. You can safely ignore this warning. |
Analyzer | Unable to find the object end for type 'RPG400Rule' | This is caused by source code that is referring to a Rule cannot be found. You can safely ignore this warning. |
Analyzer | Duplicate object of type 'MENUItem' has been detected: 'XXXXXX' | This is due to a duplicate Menu name in the original Menu file. You can safely ignore this warning. |
Analyzer | Warning after preprocessing the source code- Unknown format for ' A XA3439 R REFFLD(DATM FRFGFDI4)' | Follow Sample Reference Function Specifications |...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A REF(FILE1) (1) 00020A R RECORD1 00030A FIELD1 R (1) 00040A FIELD2 R (1) 00050A FIELD3 R REFFLD(FLD3) (2) 00060A FIELD4 R REFFLD(FLD4 FILE2) (3) 00070A FIELD5 R REFFLD(FLD5 LIB1/FILE3) (4) 00080A FIELD6 R REFFLD(RECORDB/FLD6 LIB1/FILE4) (5) 00090A FIELD7 R REFFLD(FIELD6 *SRC) (6) 00100A FIELD8 R REFFLD(FLD6) (7) 00110A R RECORD2 00120A FIELD1 20 (8) 00130A 00140A R RECORD3 00150A FIELD1 R REFFLD(RECORD2/FIELD1 *SRC) (9) 00160A 00170A R RECORD4 00180A FIELD1 R REFFLD(FIELD1 *SRC) (10) A Note: For line 00010, you can also specify library name and record format You must specify R in position 29 for each field that refers to another field that was previously defined. RPG preprocessor supports only the cases (2) and (7) : Only one parameter for the REFFLD function. |
For XXL applications, if any performance issue is experienced during the "Run Extensions at application level" step of the analysis, please contact CAST Support.
Below you can find a description of the RPG MetaModel, please click the image to download a full scale PDF version:
The following objects are displayed in CAST Enlighten:
Icon | Object Name | |
---|---|---|
1 | ![]() | MENU Bar |
2 | ![]() | MENU Item |
3 | ![]() | MENU Project |
Icon | Object Name | |
---|---|---|
1 | ![]() | CL400 Program |
2 | ![]() | CL400 Project |
3 | ![]() | CL400 Subroutine |
Icon | Object Name | |
---|---|---|
1 | ![]() | DB400 Project |
2 | ![]() | DB400 Table |
3 | ![]() | DB400 View |
4 | DB400 Library | |
5 | ![]() | DB400 Index |
6 | DB400 Record |
Icon | Object Name | |
---|---|---|
1 | ![]() | DDS400 Project |
2 | ![]() | DDS400 Section |
3 | ![]() | DDS400 PRTF File |
4 | ![]() | DDS400 DSPF File |
5 | ![]() | DDS400 Physical File |
6 | ![]() | DDS400 Logical File |
7 | ![]() | DDS400 RecordstructureLF |
8 | ![]() | DDS400 RecordstructurePF |
9 | ![]() | DDS400 Joinstructure |
Icon | Object Name | |
---|---|---|
1 | ![]() | RPG300 Project |
2 | ![]() | RPG300 Program |
3 | ![]() | RPG300 MainSubroutine |
4 | ![]() | RPG300 Subroutine |
5 | ![]() | RPG300 File Printer |
6 | ![]() | RPG300 File Disk |
7 | ![]() | RPG300 File Workstn |
8 | ![]() | RPG300 File Special |
9 | ![]() | RPG300 File Seq |
10 | ![]() | RPG300 Rule |
11 | ![]() | RPG300 Copy Member |
12 | ![]() | RPG300 File Disk Record |
13 | ![]() | RPG300 SQL Statement/Structure |
14 | ![]() | RPG300 Data Structure |
15 | ![]() | RPG300 Procedure |
16 | ![]() | RPG300 Local Record Structure |
Icon | Object Name | |
---|---|---|
1 | ![]() | RPG400 Project |
2 | ![]() | RPG400 Program |
3 | ![]() | RPG400 MainSubroutine |
4 | ![]() | RPG400 Subroutine |
5 | ![]() | RPG400 Subroutine FreeFormat |
6 | ![]() | RPG400 File Printer |
7 | ![]() | RPG400 File Disk |
8 | ![]() | RPG400 File Workstn |
9 | ![]() | RPG400 File Special |
10 | ![]() | RPG400 File Seq |
11 | ![]() | RPG400 Procedure |
12 | ![]() | RPG400 Procedure FreeFormat |
13 | ![]() | RPG400 Procedure Prototype |
14 | ![]() | RPG400 Bound Service Program |
15 | ![]() | RPG400 Copy Member |
16 | ![]() | RPG400 Data Structure |
17 | ![]() | RPG400 File Disk Record |
The following structural rules are provided: