The mainframe editor helps you organize and edit mainframe replication files throughout the pipeline lifecycle. It provides a centralized platform for managing these files, which organizes workflows and improves productivity. With the mainframe editor, you can work more efficiently and keep your mainframe replication files aligned with current standards and practices.
- You can perform the following actions on the mainframe replication file by selecting .
- Click the ellipsis next to the pipeline you wish to edit or modify the configuration, then select Edit from the dropdown menu.
- This will open the mainframe editor, where you can carry out the following actions on the mainframe replication file:
Jump to a section:
- Edit mainframe replication file
- Rename mainframe replication file
- Duplicate mainframe replication file
- Move mainframe replication file
- Delete mainframe replication file
- Set as main script
- Save and validate mainframe pipeline
- Validation Results tab
- Apply configuration changes
- Add a configuration script
Icon functionality overview
The following table describes the icons in the mainframe editor and their functions for managing files and folders in the tree structure.
| Icon | Description |
|---|---|
| New folder | Creates a new folder in the tree structure. |
| New file | Creates a new file in the tree structure. |
| Delete | Select a file or folder and click this icon to open the Delete File dialog and click Delete. |
| Expand All | Expands the tree structure. |
| Collapse All | If the tree structure is expanded, click this icon to collapse. |
| Upload Files | Opens the Upload Files dialog where you can browse to a see configuration script and select which folder to upload the file. Click Upload. |
| Download Files | Downloads a zip file of your replication pipeline. |
| Refresh | Refreshes the folder structure. |
Edit mainframe replication file
To modify a mainframe replication file, follow these steps to access the file in the Monaco Editor and make updates.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the desired file in the tree structure.
- Right-click the file to display the context menu, then choose Edit. This action will open the file in the Monaco Editor.
- Make the necessary modifications to the file.
- Click Save in the top right corner to apply your changes.
Rename mainframe replication file
To rename a mainframe replication file, follow these steps to keep your files organized and easily identifiable.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the desired file in the tree structure.
- Right-click the file to open the context menu, then choose Rename.
- Enter the new name for the file. The updated name will appear in the tree structure.
Duplicate mainframe replication file
Duplicating a mainframe replication file creates a copy for purposes such as modifications or backups. Original files remain intact.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the desired file in the tree structure.
- Right-click the file to open the context menu, then choose Duplicate. A duplicate of the file will appear in the tree structure and on the Mainframe Pipeline page, indicated with an underscore followed by a number (for example, testfile_1).
Move mainframe replication file
Moving a mainframe replication file helps maintain a structured file system. Reorganize files according to your workflow to keep related files grouped for easier access and management.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the file you wish to move in the tree structure.
- Right-click the file to open the context menu, then select Move. This will open the Move dialog, allowing you to choose the new location for the file.
- Select the desired location and click Move to relocate the file to the selected destination.
Delete mainframe replication file
Deleting a mainframe replication file is a critical action that requires careful consideration. This process is necessary when you want to remove files that are no longer needed or to clean up your workspace. However, it’s important to note that deleting files included in the main script may impact the validation of your pipeline and prevent the application of configuration changes. Follow the steps below to safely delete a file while being aware of the associated warnings and implications.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the desired file in the tree structure.
- Right-click the file to open the context menu, then choose Delete. This action will open a dialog window displaying the file name and its path, along with a warning message.
- Click Delete to proceed with the deletion, or click Cancel to exit the operation.
Set as main script
To set a file as the main script for your mainframe replication pipeline, follow these steps. The Set as Main Script option is available only for files with the .sqd extension. The main.sqd file cannot be deleted and always appears at the top of the tree structure as the primary script.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Select the desired file in the tree structure.
- Right-click the file to open the context menu, then select Set As Main Script.
Substitution variables
Substitution variables play an important role in configuring your mainframe replication pipeline. Follow the steps below to create and define variables for use in your scripts.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Click Substitution Variable button at the top of the editor to open the Substitution Variable window.
- Click +Create Variable to open the create variable window.
- Enter the name and description of the variable. Ensure that the variable syntax follows this format %(<parm_name>). Variable names cannot contain spaces or special characters (except for underscores) and must not exceed 32 characters.
- Select a data type as either String or Encrypted String.
- If you choose String, enter the corresponding value in the Value textbox.
- If you select Encrypted String, you can enter a value, but it will not be visible in the Value textbox. You cannot edit the value of an encrypted string.
- Click Create to add the new variable to the substitution variable list.
- Click Close to exit the management page.
Save and validate mainframe pipeline
After modifying the file, save and validate your mainframe pipeline to confirm that your changes are correctly applied and that the configuration script is functioning as intended.
- From the mainframe editor, double-click the file or right-click it and select Edit.
- Once the file opens in the editor, modify the main script as needed.
- Click Save and Validate button at the top of the editor. The configuration script will be saved, and the validation results will appear in the Validation Results console at the bottom of the editor.
Validation Results tab
You can adjust the validation debug logging level to control the amount of detail displayed during the validation process.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- In the Validation Results console, click the Set Debug Level icon located on the right side of the console to open the Set Validation Debug Logging Level dialog.
- Select a debug logging level: None, Low, Medium, or High. This setting will determine the level of detail displayed during validation.
- Click Save to apply the selected debug logging level.
Save
When you want to keep the changes made to a configuration script, saving those modifications is important. Follow the steps below to save your updates.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- From the mainframe editor, double-click the file or right-click it and select Edit.
- Once the file opens in the editor, modify the main script as needed.
- Click Save and Validate at the top of the editor and select Save from the drop-down. The configuration script will be saved.
Discard changes
When working on a configuration script, if you decide that the changes you've made are unnecessary, you can easily revert to the previous version by following these steps.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- From the mainframe editor, double-click the file or right-click it and select Edit.
- Once the file opens in the editor, modify the main script as needed.
- Click Save and Validate at the top of the editor and select Discard Changes from the drop-down. The changes made to the configuration script will be discarded.
Apply configuration changes
Follow the steps below to manage and implement these changes and keep your pipeline aligned with your objectives.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- From the mainframe editor, double-click the file or right-click it and select Edit.
- Once the file opens in the editor, modify the main script as needed.
- Click Save and Validate at the top of the editor and select Apply Configuration Changes from the drop-down. This opens the Apply Configuration Changes window.
- In the window, select or clear the options for Stage Configuration and Make Configuration Changes Active based on your requirements.
- Click Apply to implement the configuration changes.
Other options
Editing the pipeline options lets you modify details such as the pipeline name and description. You can also manage settings related to the automatic start of the pipeline when the runtime engine begins. Follow the steps below to update these pipeline options.
- Navigate to .
- Click ellipsis next to the pipeline and select Edit from the dropdown.
- Click the Options to open the options window.
- In the window, you can edit the Pipeline Name and Description.
- By default, the option Automatically Start Pipeline When Runtime Engine Starts is toggled On.
- You will also be able to view the details such as:
- Replication Engine: Displays replication engine associated with the pipeline that was selected at the time of pipeline creation.
- Type of replication: Displays the type of replication that was chosen at the time of creating the pipeline.
- Pipeline internal name: Displays the pipeline internal name that gets generated after the pipeline is created.
- Click Save to apply your changes.
Add a configuration script
Adding a configuration script defines the behavior and settings of your mainframe replication pipeline. This process lets you specify parameters, establish workflows, and manage task execution within the pipeline. Follow the steps in this section to create and integrate a configuration script.
- Develop a naming convention based on existing names in source and target. For example, use table name as DESCRIPTION alias (optionally with prefix).
- Use named parameters for values that will change when moving between environments (dev, test, prod). For example, database name, schema name, host name, port number, publisher name.
- It is recommended to use version control for apply engine script.
- Do NOT alter the script source code after testing.
- Obtain relevant DDL and/or record layouts for datastores.
- For Db2 and other RDBMS sources and targets, this is the CREATE TABLE statements.
- For IMS, VSAM and mainframe files, COBOL copybooks is needed.
- For Messaging system targets, record layouts are normally created automatically.
- Determine requirements for mapping to target records and filtering / transformations (if any).
- Develop the apply engine script.
- Parse the apply engine script and resolve any syntax, naming or mapping errors.
- Do a “stand-alone” test of the script.
- The apply engine will connect to the publisher, then start receiving change records and applying them to the target datastore.
- Resolve any connection or run-time errors.
- Configure the daemon to control the apply engine.
- Test operation of the apply engine through the daemon.
Description section
- The DESCRIPTION command defines the structures/layouts of source and target datastores and is used in conjunction with the DATASTORE command to associate a data structure/layout with a physical datastore.
- DESCRIPTION commands must be specified prior to any DATASTORE commands that reference fields within a DESCRIPTION structure/layout.
- It is common for a DESCRIPTION to be used by more than one DATASTORE (such as when the source and target record layouts are the same).
- Record or segment layouts are normally defined by metadata in files which are external to the script.
| Metadata type | <description_type> | Used for |
|---|---|---|
| SQL DDL (data definition language) | SQLDDL | Relational database tables |
| COBOL Copybook | COBOL |
VSAM, IMS*, mainframe file |
|
DBD (database definition) |
IMSDBD | IMS* |
| C header file | CSTRUCT |
Binary data (in a file or messaging system) |
| PL1 | PL1 |
Mainframe file |
| XML DTD (document type definition) | XMLDTD | XML data |
Syntax
DESCRIPTION <description_type> |COBOL|CSTRUCT|IMSDBD|DB2SQL|ORASQL|MSSQL|SQLDDL|XMLDTD|PL1
<file_name> | /+in line syntactically correct description on as many lines as required+/
AS <description_alias
[KEY IS <key1> [,<key2>...,<keyn>]]
[FOR SEGMENT <segment_name> IN DATABASE <dbname>]
[TOPIC <topic>]
[SUBJECT <subject>]Datastore section
- The DATASTORE command is used to specify the characteristics of source and target datastores. An Engine script may reference only one primarysource DATASTORE but may write or "apply" to multiple target datastores. There may also be secondary Prior to specifying the DATASTORE command in the script, one or more DESCRIPTION commands must be provided to describe the structure of each record in the datastore.
- A CDC Datastore may contain all the changed data for multiple physical Tables or all the different type of segments in an IMS database. Depending on the nature of the Engine processing the CDC Datastore one or more physical target Datastores may be affected.
- While a Relational Source datastore can contain only a single Table, an Engine can create multiple physical target datastores.
- A hierarchical or flat file source datastore may contain many different segments or record layouts which could result in one or more physical target datastores.
- <alias> is the name used to refer to the datastore in other sections of the apply engine script.
- One or more descriptions must be associated with the datastore.
| <datastore_type> | Used for |
|---|---|
| AVRO | Kafka |
| Binary | Files, messaging systems |
| Delimited | Files, messaging systems |
| IMSCDC | IMS CDC publisher |
| IMSDB | IMS database |
| JSON | Files, messaging systems |
| ORACLECDC | Oracle CDC publisher |
| Relational | RDBMS |
| UTSCDC | Db2 CDC publisher |
| VSAM | VSAM dataset |
| VSAMCDC | VSAM CDC publisher |
Syntax
DATASTORE <file_name>
| file://[<relative_path.> | <full_path.>] <file_name>
| <DD:ddname>[* | (<member_name>)]
| <table_name>
| RDBMS
| cdc://[<host_name_or_address>[:<port_number>]]/<agent_name>/<engine_name>
| cdcs://[<host_name_or_address>[:<port_number>]]/<agent_name>/<engine_name>
| tcp://<hostname>/<tcpip_port>
| mqs://[<qmgr_name>]/<queue_name> [:<correl_id>]
| kafka://[<hostname>[:<port_number>]] / [<kafka_topic_id>][/<partition> | key | root_key]
| hdfs://<hostname>[:<port_number>]/<hdfs_file_name>
OF <DATASTORE_TYPE> AVRO | BINARY | DB2LOAD | DELIMITED | HSSUNLOAD | IMSCDC | IMSDB | JSON | ORACLECDC | RELATIONAL | UTSCDC | VSAM | VSAMCDC | XMLCDC
[CHRDEL(‘<delchr>’)]
[COLDEL(‘<delchr>’)]
[RECDEL(‘<delchr>’)]
[CCSID <code> | ASCII | EBCDIC ]
[STAGING SIZE <nG>] -- file size in Gigabytes
[STAGING DELAY <mm>] -- rotate every mm minutes
AS <datastore_alias>
DESCRIBED BY <description_alias1> [,<description_alias2>,…, <description_aliasn>] | DUMMY
DESCRIBED BY GROUP <group_name>
[ACCEPT ALL]
[BYPASS CHGCHECK]
[CHECK FULL BEFORE IMAGE]
[COMPENSATE]
[COMPENSATE WITH WARNING]
[NO COMPENSATION]
[EXCEPTION <exception_datastore>]
[FOR CHANGE|INSERT]
[FORCE QUALIFIER <high_level>
[FORMAT [CONFLUENT | CONTAINER | PLAIN]
[IMSPATHDATA]
[KEEP NULL FIELDS]
[KEY IS <key1> [,<key2>...,<keyn>]]
[OPERATION IS <change_op_field>]
[PROCESS COMMIT]
[QUERY </+ <SQL Select and Where clause> +/>]
[RECONNECT]
[RRS]
[SINGLE IMAGE]
[STRIP TRAILING SPACES]
[WTO ON COMPENSATION EVERY <n> MINUTES]
[WTO ON EXCEPTION ONCE]Main processing section
- The Main body of the processing portion of the script.
- Initiates a processing loop beginning with the first record of the source datastore until the last record has been processed.
- The main processing section has three (3) commands:
- PROCESS INTO - The PROCESS INTO Command is used only once in the Apply Engine script. It initiates a processing loop beginning with the first record of the source datastore that continues until the last record from the source datastore has been processed.
- SELECT … FROM- Pair of commands (always used together) that defines the processing loop. Contains source-to-target mapping and transformation logic (if any), often implemented by calling named procedures (CALLPROC).
- UNION- Allows for “chaining” of multiple SELECT-FROM pairs [optional]
PROCESS INTO
PROCESS INTO identifies the target datastore(s) that will be acted upon by the script and is used in conjunction with the FOR <action> parameter specified in the DATASTORE command for the target datastore which explicitly states how the data will be applied to the target.
PROCESS INTO <target_datastore(s)>
SELECT
{
Mapping logic and/or procedure calls go here
}
FROM <source_datastore> where <target_datastore(s)>
PROCESS INTO <target_datastore> [, <target_datastore>]
SELECT [UNION];SELECT
- Reads records from a source datastore, returning the fields listed within the sub-command. This functionality is similar to the SQL SELECT command.
- Specifies the target fields that will be updated in one or more target datastores.
- Specifies the source to target field mapping where the results will be written to one or more target datastores.
- Enables the use of Apply Engine functions that can be used for business logic, data transformation, filtering, etc.
SELECT
SELECT *
SELECT <source_field> [, <source_field>]
SELECT <source_field> [, <source_field>] <target_field> [, <target_field>]
SELECT <source_field> [, <source_field>] <field_alias> [, <field_alias>]
SELECT <function_set> [, <function_set>] <target_field> [, <target_field>]
SELECT <function_set> [, <function_set>] <field_alias> [, <field_alias>]
FROM source_datastore | NOTHING
;UNION
The UNION sub-command chains multiple SELECT sub commands together within a the main Process Command to perform ‘multi-step’ processing within an Apply Engine script. When the UNION sub-command is used, the second SELECT sub-command is executed after the first SELECT sub-command has completed.
UNION
SELECT [UNION];