Skip to main content
Develop Tools
← Return to usage guide

How to safely mask and share COBOL code

For COBOL incident investigation or modernization consultations, code that retains data definitions and processing order is helpful. However, prepare it without directly exposing business names, customer information, dataset names, or CALL targets externally.

Flow for masking business-specific information in COBOL code in the browser before sharing it with AI
Flow for masking business-specific information in COBOL code in the browser before sharing it with AI

Mask COBOL code in the browser

Select program names, sections/paragraphs, data items, values, and comments to create a shareable copy that considers COBOL column structure. Input source is not sent to or stored on Develop Tools servers.

Open COBOL Code Masking Tool

Conclusion

Replace customer information and business-specific names, and create a sharing copy that retains DIVISION, SECTION, level numbers, PIC, USAGE, and processing statements.

Do not edit the original source directly; work on a shareable copy.

Do not treat COBOL as simple string replacement

PROGRAM-ID, data items, paragraphs, and file names correspond to their references. Changing everything to FILLER or changing the same original name to different names loses investigation material.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. CUSTOMER-PAYMENT-BATCH.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-CUSTOMER-NO     PIC X(10).
       01  WS-PAYMENT-AMOUNT  PIC S9(9)V99 COMP-3.
       IDENTIFICATION DIVISION.
       PROGRAM-ID. Class001.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  variable001        PIC X(10).
       01  variable002        PIC S9(9)V99 COMP-3.

How to verify results with the COBOL code masking tool

  • 1. Extract the minimum scope that explains the issue into a separate copy.
  • 2. Select the programs, sections/paragraphs, data items, values, and comments to process.
  • 3. After masking, check whether declarations and references with the same name correspond.
  • 4. Check whether PIC, COMP-3, REDEFINES, OCCURS, FILE STATUS, and similar items can be read.
  • 5. Restore only required numeric values by right-clicking, then share only the result.

Checklist to prevent oversights

CategoryAccount to check
People and customersName, customer number, contract number, account number
systemPROGRAM-ID, business name, COPYBOOK, and CALL target
FileSELECT name, ASSIGN name, Dataset, and DD name
Code structurePIC, USAGE, level numbers, paragraphs, and references

How to think about examples

Replace PROGRAM-ID and data item names with sequential names while retaining PIC X(10) and PIC S9(9)V99 COMP-3. This allows explanation of digit counts and internal representations.

Final check before external sharing

  • Search for any remaining customer names, contract numbers, account numbers, employee numbers, branch codes, or business codes
  • Check whether the system can be inferred from PROGRAM-ID, data items, paragraphs, file names, COPYBOOK names, and CALL target names.
  • Also check VALUE clauses, DISPLAY statements, comments, SQL Literals, URLs, Dataset names, and DD names
  • Compare whether the forms needed to investigate PIC, USAGE, COMP-3, level numbers, REDEFINES, and OCCURS remain.
  • When numbers are masked, individually unmask values required for explanation, such as OCCURS counts and level 88 values, with right-click
  • Share only the masking results, and retain the original source and correspondence table in an access-controlled location

Masking results alone may not completely prevent information leakage. Check whether ABEND logs, JCL, dumps, COPYBOOKs, and screenshots sent with the code also contain the same information.

What the COBOL code masking tool can and cannot do

ItemCurrent supportPoints to note
InputPaste COBOL textDo not directly load .cbl, .cob, or .cpy files or convert EBCDIC.
Source formatEstimate fixed format and also track >>SOURCE FORMAT FREE/FIXEDIt is not complete parsing equivalent to a compiler
IdentifiersClassify PROGRAM-ID, paragraphs and sections, data items, COPY names, and similar items.Map the same name to the same replacement name regardless of case.
PreservePreserve sequence numbers, indicator fields, level numbers, and PIC clausesWhen masking values, numbers outside PIC, such as VALUE and OCCURS counts, also become 0
ReferenceSupports same-name references such as PERFORM, THRU, REDEFINES, RENAMES, and DEPENDING ON.Does not guarantee semantic analysis or successful compilation
embeddedProcess host variables and identifiers within EXEC SQL at the token level as wellNot a complete Parser dedicated to SQL or CICS.
outputCopy results, individually unmask by right-clicking, and clear allNo file saving, mapping list, S0C7 diagnosis, or automatic correction
PrivacyProcess input and masking in the browser.Do not send or save source code or results to the Develop Tools server

This Tool is an assistance feature for creating a shareable copy. It does not replace Build and execution verification using the COBOL compiler, COPYBOOK, JCL, and real data in use.

Check the official documentation for the compiler in use

COBOL language specifications, internal representations, FILE STATUS, and compiler options vary by product and version. Verify explanations using IBM Enterprise COBOL as an example against primary sources, and do not apply them directly to other products.

Example: Paste the definition of a customer payment batch into AI

Replace PROGRAM-ID and data item names with sequential names while retaining PIC X(10) and PIC S9(9)V99 COMP-3. This allows explanation of digit counts and internal representations.

Masking results are not syntax analysis, compilation, or automatic diagnosis results for S0C7 or I/O errors. Compare with the original source and visually confirm the structure needed for investigation and information that need not be shared.

  1. Extract the smallest scope that reproduces the issue
  2. Mask identifiers, values, and comments
  3. Check PIC, USAGE, and reference relationships
  4. Share only the result

If sending JCL, ABEND logs, dumps, real data, and COPYBOOK together, check each item separately.

Frequently asked questions

Can COBOL compilation errors and S0C7 also be fixed automatically?
It cannot be fixed. The tool masks content for sharing. Diagnose with the compiler in use, Language Reference, and execution environment.
Are PIC, COMP-3, REDEFINES, and OCCURS preserved?
PIC clauses, Keywords, level numbers, and same-name references are considered. However, masking values also changes non-PIC numbers such as OCCURS counts to 0, so individually unmask required numbers by right-clicking them in the results.
Is the entered COBOL source sent to a server?
Input and masking results are processed in the browser and are not sent to or stored on the Develop Tools server.