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 ToolConclusion
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
| Category | Account to check |
|---|---|
| People and customers | Name, customer number, contract number, account number |
| system | PROGRAM-ID, business name, COPYBOOK, and CALL target |
| File | SELECT name, ASSIGN name, Dataset, and DD name |
| Code structure | PIC, 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
| Item | Current support | Points to note |
|---|---|---|
| Input | Paste COBOL text | Do not directly load .cbl, .cob, or .cpy files or convert EBCDIC. |
| Source format | Estimate fixed format and also track >>SOURCE FORMAT FREE/FIXED | It is not complete parsing equivalent to a compiler |
| Identifiers | Classify PROGRAM-ID, paragraphs and sections, data items, COPY names, and similar items. | Map the same name to the same replacement name regardless of case. |
| Preserve | Preserve sequence numbers, indicator fields, level numbers, and PIC clauses | When masking values, numbers outside PIC, such as VALUE and OCCURS counts, also become 0 |
| Reference | Supports same-name references such as PERFORM, THRU, REDEFINES, RENAMES, and DEPENDING ON. | Does not guarantee semantic analysis or successful compilation |
| embedded | Process host variables and identifiers within EXEC SQL at the token level as well | Not a complete Parser dedicated to SQL or CICS. |
| output | Copy results, individually unmask by right-clicking, and clear all | No file saving, mapping list, S0C7 diagnosis, or automatic correction |
| Privacy | Process 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
- IBM Enterprise COBOL for z/OS 6.5 Documentation
- IBM Documentation: NUMCHECK
- IBM Documentation: FILE STATUS clause
- IBM Documentation: REDEFINES clause
- IBM Documentation: COBOL reference format
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.
- Extract the smallest scope that reproduces the issue
- Mask identifiers, values, and comments
- Check PIC, USAGE, and reference relationships
- 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.