Skip to main content
Moderne OnlyThis recipe is proprietary to Moderne and runs on the Moderne platform or CLI — it isn’t part of the open-source catalog. Available with a Moderne subscription.Contact Sales

List what runs a variable

Recipe IDio.moderne.mainframe.lineage.AnalyzeVariableChain
Artifactio.moderne.recipe:recipes-mainframe

Record every way a variable reaches the scheduler: the copybook that declares it, each program that uses it, the load module the program is bound into, the procedure and job step that run that module, and the Control-M definition that submits the job. A chain that stops short is reported as far as it got, so a field that reaches no batch job is a row saying so rather than a gap. FindVariableChain answers the same question and marks each source at the link it contributes; this one produces the table and changes nothing.

Single recipeOpenRewriteModerne Proprietary License
Try in PlatformTry this recipe in the Moderne platform. Not a user yet? You’ll get a no-setup demo environment, with nothing to install or configure.

Options​

1 parameters
1 required
ParameterExampleTypeRequired
variableCLM-AMT-RESERVEDStringRequired
The variable to follow, matched against the whole name without regard to case and without its qualifiers. Accepts a regular expression.

Usage​

Run this recipe

You will need to have configured the Moderne CLI on your machine before you can run the following command.

shell
mod run . --recipe AnalyzeVariableChain --recipe-option "variable=CLM-AMT-RESERVED"

If the recipe is not available locally, then you can install it using:

RELEASE resolves to the newest release and LATEST to the newest build of any kind, including snapshots. Either one lets mod config recipes upgrade pull in later versions without editing this command; a pinned version stays where you put it.

mod config recipes jar install io.moderne.recipe:recipes-mainframe:RELEASE

Data tables​

Variable chain
io.moderne.mainframe.analysis.table.VariableChain

One row per way a variable reaches the scheduler: the copybook that declares it, the program that uses it, the load module the program is bound into, the procedure and job step that run that module, and the Control-M definition that submits the job. Six sources have to be joined to say what runs tonight if a field is widened, and each holds only its own link — the copybook does not know its programs, the program does not know its module, the module does not know its job, and the job does not say when it runs. A chain that stops short is reported as far as it got, so a field that reaches no batch job at all is a row and not a gap.

Export after a run
mod study . --last-recipe-run \
--data-table io.moderne.mainframe.analysis.table.VariableChain
ColumnDescription
VariableThe variable, qualified by the records containing it. Two fields of a name in different records are different variables and each has its own chains.
CopybookThe copybook that declares it, or empty where the program declares it itself. A field copied in is one field to change and many to retest, which is what makes the rest of the row worth joining.
Source pathThe file the declaration is in: the copybook where it was copied in, the program otherwise. Empty for a copybook no ingestion holds.
ProgramThe program that declares the variable, which is where a change to it is compiled.
UsageREAD, WRITTEN, BOTH, or UNUSED where the program declares the variable and never touches it. A chain through an unused field is a chain the change does not have to be tested along.
Load moduleThe module the program is bound into, from the link-edit deck that declares it or the listing that reports it. A subroutine is bound into every module that includes it and has a chain through each. Empty where nothing read says how the program is linked, and then the job is joined by the program's own name, which is what a step asks for.
Load libraryThe library the module is written to. It is what tells a batch module from a CICS one where both carry the program's name, and a module in a CICS library is why a chain stops here.
ProcedureThe procedure the step is written in, empty for a step written in the job itself. A job read without its procedure library has no procedure steps to report, so the chain stops at the module rather than naming one.
StepThe step that runs the module, qualified by the step that called its procedure — EXTRACT.RUN — which is how a listing names it.
JCL memberThe member the step is in, which is the file to open and the name the scheduler submits. Empty where no job read runs the module: an online program, or a batch one whose job was not supplied.
JCL pathThe file that member was read from, empty where no job read runs the module.
JCL lineThe one-based line of the step's EXEC card. A step a procedure supplies has no line in the job, so it is the calling EXEC card that is given — the line the job's reader has.
ScheduleThe name the scheduler knows the job by. A member ordered under more than one table has a chain for each. Empty where no definition submits it, which is either a job run by hand or a schedule nobody exported.
Schedule tableThe table the job is ordered in, which is what says when it runs.
HopsHow many of the six links the chain names — copybook, program, load module, procedure, job, schedule — so that a complete chain sorts above a chain that stopped. A step written in the job itself has no procedure, so six is not the only complete answer.
Source files that had results
org.openrewrite.table.SourcesFileResults

Source files that were modified by the recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileResults
ColumnDescription
Source path before the runThe source path of the file before the run. null when a source file was created during the run.
Source path after the runA recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run.
Parent of the recipe that made changesIn a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all.
Recipe that made changesThe specific recipe that made a change.
Estimated time savingAn estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds.
CycleThe recipe cycle in which the change was made.
Source files that had search results
org.openrewrite.table.SearchResults

Search results that were found during the recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SearchResults
ColumnDescription
Source path of search result before the runThe source path of the file with the search result markers present.
Source path of search result after run the runA recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run.
ResultThe trimmed printed tree of the LST element that the marker is attached to.
DescriptionThe content of the description of the marker.
Recipe that added the search markerThe specific recipe that added the Search marker.
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrors

The details of all errors produced by a recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileErrors
ColumnDescription
Source pathThe file that failed to parse.
Recipe that made changesThe specific recipe that made a change.
Stack traceThe stack trace of the failure.
Recipe performance
org.openrewrite.table.RecipeRunStats

Statistics used in analyzing the performance of recipes.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.RecipeRunStats
ColumnDescription
The recipeThe recipe whose stats are being measured both individually and cumulatively.
Source file countThe number of source files the recipe ran over.
Source file changed countThe number of source files which were changed in the recipe run. Includes files created, deleted, and edited.
Cumulative scanning time (ns)The total time spent across the scanning phase of this recipe.
Max scanning time (ns)The max time scanning any one source file.
Cumulative edit time (ns)The total time spent across the editing phase of this recipe.
Max edit time (ns)The max time editing any one source file.