RPG, RPGLE, RPG 400

AWS Blu Insights supports RPG (Report Programming Generator) dependencies analysis in the mainframe group. It detects dependencies among programs (e.g. RPG, RPGLE) as well as other file types (e.g. CL, PF, LF…).

 

Direct dependency

Logical dependencies

CALL

The CALL statement implies a dependency on a CL or an RPG file.

  • CALL PROGRAM in .RPG and .RPGLE files
  • CALL(EXTENDERS) PROGRAM in .RPG and .RPGLE files. There can be one or several extenders among A, H, N, P, D, T, Z, M, R, E.

Where PROGRAM can be a raw string or a variable declared in the same file with EXTPGM or EXTPROC.

 

CALLB

The CALLB statement implies a dependency on a CL or an RPG file.

  • CALLB PROGRAM in .RPG and .RPGLE files
  • CALLB(EXTENDERS) PROGRAM in .RPG and .RPGLE files. There can be one or several extenders among A, H, N, P, D, T, Z, M, R, E.

Where PROGRAM can be a raw string or a variable declared in the same file with EXTPGM or EXTPROC.

 

CALLP

The CALLP statement implies a dependency on a CL or an RPG file.

  • CALLP PROCEDURE in ‘.RPG’ and ‘.RPGLE’ files
  • CALLP(EXTENDERS) PROCEDURE in ‘.RPG’ and ‘.RPGLE’ files. There can be one or several extenders among A, H, N, P, D, T, Z, M, R, E.

Where PROCEDURE can be a raw string or a variable declared in the same file with EXTPGM or EXTPROC.

Procedures can be declared in RPG files :

  • Global : P PROCEDURE B EXPORT
  • Local : P PROCEDURE B
  • An implicit procedure is declared for each ‘.RPG’ or ‘.RPGLE’ files

 

Inclusion dependencies

COPY

  • COPY FILE
  • COPY LIBRARY,FILE

Where LIBRARY is the name of a library and FILE is the name of a file in the project.

 

INCLUDE

  • INCLUDE FILE
  • INCLUDE LIBRARY,FILE

Where LIBRARY is the name of a library andFILE is the name of a file in the project.

 

Resource dependencies

DTAARA

The call on DTAARA implies a dependency on a file that is not an RPG (PF, LF, RPGLE, PRTF…) nor a Mainframe file.

  • DTAARA DEFINE DATAOBJECT
  • DTAARA DEFN DATAOBJECT

Where DATAOBJECT is the name of a file in the project.

 

EXTNAME

The call on EXTNAME implies a dependency on any other file.

  • EXTNAME(filename)

Where filename is the name of a file in the project.

 

FLINE

  • Ffilename (C|I|O|U)

Where filename is the name of a file in the project.

The call on FLINE can implied a dependency on a PRTF, PRT, LF or PF file if the file definitions are not included in the RPG program by I/O lines

  • Ifilename are for input files defined with a C, I and U flag
  • Ofilename are for output files defined with a C and O flag

 

FORMAT

The call on FORMAT implies a dependency on a PRTF, PRT, LF or PF file.

  • FORMAT(ddsFile)

Where ddsFile is the name of a file in the project.

 

JFILE

The call on JFILE implies a dependency on a PRTF, PRT, LF, PF or DDS file.

  • JFILE(ddsFile)

Where ddsFile is the name of a file in the project.

 

PFILE

The call on PFILE implies a dependency on a PRTF, PRT, LF, PF or DDS file.

  • PFILE(ddsFile)

Where ddsFile is the name of a file in the project.

 

REF

The call on REF implies a dependency on a PRTF, PRT, LF or PF file.

  • REF(ddsFile)

Where ddsFile is the name of a file in the project.

 

REFFLD

The call on REFFLD implies a dependency on a PRTF, LF, PF or DDS file.

  • REFFLD([recName/]refName [libName/]ddsFile)

Where ddsFile is the name of a file in the project, refName is mandatory and doesn’t apply any dependency, recNameand libName are optional and doesn’t apply any dependency.

 

External DataStruture

The call on E DS implies a dependency on a PRTF, LF, PF or DDS file.

  • Ifilename  E DSddsFile

Where ddsFile is the name of a file in the project and filename doesn’t apply any dependency.

QDDS and QDDSI files

A physical file named filename.pf will be linked to a file named prefix.filename.qdds if it exists

A logical file named filename.lf will be linked to a file named prefix.filename.qddsi if it exists

 

Dynamic dependencies

In RPG, it is possible to store entities name in constant and use it in any type of dependency

 

Constant definition

D CONST_NAME C CONST('PROG_TO_CALL')

This constant named CONST_NAME can be used to call PROG_TO_CALL

 

Transparent constant

I 'PROG_TO_CALL' C CONST_NAME

This constant named CONST_NAME can be used to call PROG_TO_CALL

 

RPG Free form

Freeform sections are part of RPG source code starting with /free and ending with /end-free

To determine dependencies to program, procedure or ddsFile in these sections, we are looking for usage of previously defined variables or alias like :

  • Dvariable Pr ExtPgm('program')
  • Dvariable Pr ExtProc('procedure')
  • Fvariable E DISK Rename(ddsFile:alias)

SQL statement

Computation line

In RPG computation lines (C) a SQL query starts with Exec SQL and ends with End-Exec. All lines starting with + is a continuation.
00000C/Exec SQL Update USER
00000C+ Set LAST-NAME = "DOE"
00000C+ Where NAME = "JANE"
00000C/End-Exec

Refer to dependencies in SQL file documentation for further information

 

Free form

In a Free Form section, a SQL query starts with Exec SQL and ends with ;.
/Free
Exec SQL Update USER
Set LAST-NAME = "DOE"
Where NAME = "JANE";
/End-Free

Refer to dependencies in SQL file documentation for further information