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

Find column lineage

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

Report every field the program writes out and the field outside the program that fed it, in the shape a data catalog wants it. Each row is one entry of OpenLineage's column lineage facet: the program is the job, a file, queue, map, IMS segment, SQL table or terminal is the dataset, and the COBOL field is the column. The route between the two boundaries comes with it, so the claim can be checked, along with the exact position of the statement that wrote the value out — which is what a catalog needs to show the code behind a lineage edge rather than merely assert it. Where the map sets are on disk, a row about a screen names the field the mapset declares rather than the data item BMS generated from it, so both ends of the row read as a person would name them.

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.

Usage​

Run this recipe

This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.

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

shell
mod run . --recipe FindColumnLineage

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​

Column lineage
io.moderne.mainframe.analysis.table.ColumnLineage

Which input field feeds each field the program writes out, in the shape OpenLineage's column lineage facet asks for, with the statement that did it.

Export after a run
mod study . --last-recipe-run \
--data-table io.moderne.mainframe.analysis.table.ColumnLineage
ColumnDescription
ProgramThe PROGRAM-ID, which is the job the lineage belongs to.
Source pathThe program's file, which the offsets below index into.
Input namespaceThe technology the value came in through, as a scheme: cics://file, ims://segment, sql://table, file://record and so on. The kind is in the namespace rather than the name because a CICS file and a CICS queue can share one. Empty when nothing outside the program feeds the field.
Input datasetThe resource the value came from, or the kind of endpoint where the statement names none. A screen is named mapset.map, which is what identifies it across an estate; a program that decides at run time which map it sends still gets the map it sent, read off the record BMS generated.
Input fieldThe field the value landed in when it entered the program, qualified by the records containing it — or, where the resource has its own name for it, that name: the column a SELECT read, or the screen field an operator typed into.
Output namespaceThe technology the value goes out through, in the same scheme form as the input.
Output datasetThe resource written, named the same way as the input.
Output fieldThe field whose value crossed the boundary. A row about a screen names the field the mapset declares rather than the data item BMS generated from it, so TRNNAMEO reads as TRNNAME. The length, flag and attribute bytes of a screen field drive the terminal rather than carrying a value, and are not rows.
Transformation typeAlways DIRECT. A field only tested in a condition moves no value and is never an edge, so this analysis never has the INDIRECT kind to report.
Transformation subtypeIDENTITY when every step along the route only copies the value, TRANSFORMATION when arithmetic, STRING or UNSTRING changed it.
StepsHow many statements the value passes through, counting the one that brought it in and the one that wrote it out. One means it was read and written by a single statement.
PathThe route the value takes, statement by statement. This is what makes the answer reviewable rather than something to be taken on trust.
Output lineWhere the statement that wrote the value out begins, one-based.
Output columnThe column that statement begins at, one-based. Sequence numbers and the identification area are not part of it.
Output start offsetThe statement's first character, as an index into the source file. This is what a catalog that highlights the code it is describing asks for.
Output end offsetOne past the statement's last character. Zero, with the offset and line, when a copybook wrote the statement and it has no position in this program.
Input lineWhere the statement that brought the value in begins, one-based. A program often reads the same table twice, and without this the two rows differ in nothing a reader can see.
Input start offsetThat statement's first character, as an index into the source file.
Input end offsetOne past that statement's last character. Zero when the value came from nowhere outside the program, or the statement was written by a copybook.
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.