CL

Control Language (CL) for iSeries is supported in the Mainframe dependencies group. Statements are matched case-insensitively, after + continuation lines have been joined and /* … */ comments removed. A library qualifier (LIBNAME/, *LIBL/, *CURLIB/) in front of a name is accepted and ignored: the dependency is resolved on the name alone. Links from a CL file (multiple extensions are supported, e.g. CL, CLLE, etc.) to other files are detected following the statements listed below:

CALL / CALL PGM

The call to CALL, CALL PGM or CALLPGM implies a dependency on a .CL or a .RPG file.

  • CALL file
  • CALL "file"
  • CALL PGM(file)
  • CALL PGM("file")
  • CALLPGM(file)
  • CALLPGM("file")
  • CALL(path)
  • CALL PGM(path)
  • CALLPGM(path)

Where file is the name of a CL or RPG file in the project and path is a combination of library and file like *LIBL/file, *CURLIB/file and LIBNAME/file      
*LIBL – Search for the target file name in all libraries and establish the dependency with all matches      
*CURLIB – Search for the target file name from the root of the source file path; a dependency link is created for the matched target      
LIBNAME – Search for the folder named LIBNAME from the root of the source file path and get the list of matched target files      
If LIBNAME is not found during the analysis, a Missing library node named LIBNAME is created.

To address this file, you can also use an explicit path notation (no relative path like ../my/parent/file). If no file corresponds to the path, we will mark it as a missing one.

CALLPRC

The call to CALLPRC PRC implies a dependency on any kind of file except .CPY.

  • CALLPRC PRC(file)
  • CALLPRC PRC('file')
  • CALLPRC PRC("file")

Where file is the name of a non-CPY file in the project.      
To address this file, you can also use an explicit path notation (no relative path like ../my/parent/file). If no file corresponds to the path, we will mark it as a missing one.

Along with the file, the CALLPRC PRC command also maps to a global procedure:

  • CALLPRC PRC(procedure-name)

Where procedure-name is a global procedure defined in a file such as an sqlrpgle. Refer to the procedure declaration statement.

CLRPFM

The call to CLRPFM implies a "CLRPFM" dependency on the cleared file (a PF, or any file of the project with that name).

CLRPFM file
CLRPFM+file
CLRPFM FILE(file)
CLRPFM FILE(LIBNAME/file)

Where file is the name of a file in the project. Trailing parameters (MBR(…)) are ignored. When no file of the project matches, no dependency is created.

Example: CLRPFM FILE(MYLIB/CUSTPF)

Creates:

{
    "dependencyType": "CLRPFM",
    "name": "CUSTPF.PF",
    "path": "dds/CUSTPF.PF",
    "type": "PF"
}

DTAARA

The reference to a DTAARA implies a dependency on a DTAARA object. It can be used along with the RTVDTAARA, CHGDTAARA and CRTDTAARA commands.

  • RTVDTAARA DTAARA(MYDATAOBJECT)
  • RTVDTAARA DTAARA(path/to/MYDATAOBJECT)
  • RTVDTAARA DTAARA(&MYDATAVAR) where &MYDATAVAR is a variable referencing a DTAARA object.

Where MYDATAOBJECT is the name of a DTAARA object in the project.

FILE

FILE is a keyword parameter, found on many commands (DCLF, OVRDBF, CPYF, OPNQRYF, DLTF, CHGPF, …). Whatever the command, a FILE(…) parameter implies a "File operation" dependency on the named file.

command FILE(file)
command FILE(LIBNAME/file)

Where file is the name of a file in the project, whatever its type (typically a PF, LF, DSPF or PRTF). When no file of the project matches, no dependency is created. The same rule applies to the FROMFILE, TOFILE and OPNID parameters.

Commands that have a rule of their own take precedence: CLRPFM FILE(…), RGZPFM FILE(…) and INZPFM FILE(…) produce only their "CLRPFM", "RGZPFM" or "INZPFM" dependency, and CRTSRCPF FILE(…) and DSPFD FILE(…) produce none:

  • CRTSRCPF FILE(file)
  • DSPFD FILE(file)

Example: DCLF FILE(DSPF_FILE1)

Creates:

{
    "dependencyType": "File operation",
    "name": "DSPF_FILE1.DSPF",
    "path": "dds/DSPF_FILE1.DSPF",
    "type": "DSPF"
}

FROMFILE

FROMFILE is a keyword parameter, found on commands such as CPYF or CPYFRMQRYF. Whatever the command, a FROMFILE(…) parameter implies a "File operation" dependency on the named file, following the same rule as FILE.

command FROMFILE(file)
command FROMFILE(LIBNAME/file)

Where file is the name of a file in the project, whatever its type. When no file of the project matches, no dependency is created.

INCLUDE SRCMBR

The call to INCLUDE with SRCMBR implies an "Include source member" dependency on the included source member.

INCLUDE SRCMBR(member)
INCLUDE SRCFILE(LIBNAME/file) SRCMBR(member)

Where member is the name of a CL file in the project. A member that is not in the project is reported as "Missing Program".

INZPFM

The call to INZPFM (initialize a physical file member) follows the same syntax as CLRPFM and implies an "INZPFM" dependency on the file.

INZPFM file
INZPFM FILE(file)
INZPFM FILE(LIBNAME/file)

Where file is the name of a file in the project. Trailing parameters (RECORDS(…), TOTRCDS(…)) are ignored. When no file of the project matches, no dependency is created.

OPNID

OPNID is a keyword parameter, found on commands such as OPNQRYF, RCVF, POSDBF or CLOF. Whatever the command, an OPNID(…) parameter implies a "File operation" dependency on the named file, following the same rule as FILE.

command OPNID(file)
command OPNID(LIBNAME/file)

Where file is the name of a file in the project, whatever its type. When no file of the project matches, no dependency is created.

RGZPFM

The call to RGZPFM (reorganize a physical file member) follows the same syntax as CLRPFM and implies a "RGZPFM" dependency on the file.

RGZPFM file
RGZPFM FILE(file)
RGZPFM FILE(LIBNAME/file)

Where file is the name of a file in the project. Trailing parameters (MBR(…), RCDFMT(…), KEYFILE(…)) are ignored. When no file of the project matches, no dependency is created.

RQSDTA

The call to RQSDTA implies a dependency on a .CL or a .RPG file.

  • RQSDTA('CALL file')

Where file is the name of a CL or RPG file in the project.

RUNQRY QRYFILE

The call to RUNQRY QRYFILE implies a "Run query" dependency on the queried data file(s).

  • RUNQRY QRYFILE(FILE1)
  • RUNQRY QRYFILE(MYLIB/FILE1)
  • RUNQRY QRY(MYQRY) QRYFILE((MYLIB/FILE1) (MYLIB/FILE2))

Where FILE1 and FILE2 are the names of queried files in the project. In the list form, a dependency is detected toward each file of the list (up to 32 files).

RUNSQL

The call to RUNSQL executes an SQL statement given as a quoted literal. The statement is analysed with the SQL rules and the resulting dependencies ("Select query", "Insert query", "Update query", "Join query", "Delete/Drop query", …) are attached to the CL program. Check the SQL dependencies for the statements recognised.

RUNSQL SQLSTM('statement')
RUNSQL SQL('statement')

Both keywords are accepted. The literal may contain doubled quotes ('') and may be followed by other parameters (COMMIT(*NONE), NAMING(*SQL), …). A statement built at run time from a CL variable (SQL(&STMT)) is not analysed.

Example: RUNSQL SQL('SELECT * FROM TABLE1 WHERE A = COALESCE(''0'')') COMMIT(*NONE)

Creates:

{
    "dependencyType": "Select query",
    "name": "TABLE1",
    "path": "Global:TABLE:TABLE1",
    "type": "[SQL]TABLE"
}

A table that is not defined in the project is reported as "Missing Database Object".

RUNSQLSTM

The call to RUNSQLSTM implies a "Run SQL statements source" dependency on the SQL source member named by SRCMBR.

RUNSQLSTM SRCFILE(LIBNAME/file) SRCMBR(member)
RUNSQLSTM SRCMBR(member) SRCFILE(LIBNAME/file) COMMIT(*NONE)

Where member is the name of an SQL source file in the project. Parameters may appear in any order; SRCFILE is not used for the resolution. A member named through a CL variable (SRCMBR(&MBR)) is not detected. A member that is not in the project is reported as "Missing Program".

Example: RUNSQLSTM SRCFILE(QTEMP/QSQLSRC) SRCMBR(C3PRC01)

Creates:

{
    "dependencyType": "Run SQL statements source",
    "name": "C3PRC01",
    "path": null,
    "type": "Missing Program"
}

The SQL statements of the member are analysed as part of that SQL file, not as part of the CL program.

SNDPGMMSG

The call to SNDPGMMSG implies a dependency on a .MSGF file.

  • SNDPGMMSG MSGID(&ERRORID) MSGF(MESSAGEFILE)
  • SNDPGMMSG MSGID(&ERRORID) MSGF(*LIBL/MESSAGEFILE)

Where MESSAGEFILE is the name of a MSGF file in the project.

Temporary Object definition

A temporary object can be defined with the OVRPRTF, OVRDBF and CRTPF statements; it behaves like an alias of an external file. Other programs can use this object to refer to the source file.

CL_FILE.cl

OVRPRTF     FILE(MY_ALIAS) TOFILE(MY_FILE)
CALL       PGM(RPG_FILE)
DLTOVR     FILE(MY_ALIAS)
CRTPF     FILE(MY_FILE) SRCFILE(MY_ALIAS)
CALL       PGM(RPG_FILE)
DLTOVR     FILE(MY_ALIAS)

RPG_FILE.rpgle

     FMY_ALIAS  IF   E           K DISK

In this example, we create the temporary object MY_ALIAS as an alias of MY_FILE. Then RPG_FILE calls this object through an F line, which implies a dependency between RPG_FILE and MY_FILE. OVRPRTF and OVRDBF share the same pattern; CRTPF uses different keywords.

TOFILE

TOFILE is a keyword parameter, found on commands such as CPYF or CPYSRCF. Whatever the command, a TOFILE(…) parameter implies a "File operation" dependency on the named file, following the same rule as FILE. On OVRPRTF and OVRDBF, TOFILE is also part of the temporary object definition.

command TOFILE(file)
command TOFILE(LIBNAME/file)

Where file is the name of a file in the project, whatever its type. When no file of the project matches, no dependency is created.