How to use this tool
What it does
Runs a COBOL program you paste one statement at a time, and shows every field change, including packed bytes.
How to use it
- Paste a COBOL program, or press Example.
- Press Start, then Step for one statement or Run to a breakpoint.
- Watch every field change, including packed bytes.
What it cannot do
- It simulates the program; it is not a compiler and does not run Db2 or CICS.
- Some statements stop the run with a message.
- Compiler and run-time options of your site can change results.
- Next tool: COBOL structure analyser ▸ See the whole program's paragraphs and CALLs.
- Guide: S0C7: where to look first
- Code page: S0C7 data exception
What this page remembers
To save you retyping, this page keeps your program, input data, COPY members and settings in this browser on this device (never sent anywhere). On a shared computer, clear them when you finish.
Input data and COPY members
Input files and SYSIN appear here when the program reads them.
One record per line. A line written as X'C1C2…' gives exact bytes, for packed fields. Each COPY member gets its own box; the listing then shows the program with the member expanded (lines marked C), as a compiler listing does.
Called programs
A CALL 'NAME' (or CALL identifier, using the identifier's value) runs the pasted program with that PROGRAM-ID. Arguments match the called program's USING by position: BY REFERENCE shares storage, BY CONTENT and BY VALUE pass a copy. A called program keeps its WORKING-STORAGE between calls until it is CANCELed (or if it is IS INITIAL); GOBACK and EXIT PROGRAM return, STOP RUN ends everything.
Start the program as if Db2 had called it: give each PROCEDURE DIVISION USING parameter a value, and type the rows each cursor should return. At the end you see the parameter values handed back and the result sets.
Runs fixed-format or free-format Enterprise COBOL: WORKING-STORAGE, LOCAL-STORAGE and LINKAGE, COPY members, CALL and CANCEL of programs you paste (USING BY REFERENCE, BY CONTENT, BY VALUE, OMITTED, RETURNING, ON EXCEPTION), sequential files (READ, WRITE, REWRITE), SORT of a file with an SD (USING, GIVING, INPUT and OUTPUT PROCEDURE with RELEASE and RETURN), MOVE and MOVE CORRESPONDING, COMPUTE, ADD … DIVIDE (and ADD / SUBTRACT CORRESPONDING), IF, EVALUATE, PERFORM (THRU, UNTIL, VARYING), GO TO, SEARCH, INSPECT, STRING, UNSTRING, INITIALIZE (with FILLER, VALUE, REPLACING, DEFAULT), SET, DISPLAY and ACCEPT, with COMP-1 and COMP-2 floating point stored as IBM hexadecimal (plain MOVEs keep every bit, but arithmetic on COMP-2 keeps about 15 to 16 significant digits, a little less than z/OS). EXEC SQL and EXEC CICS stop and ask you for the result; in stored-procedure mode, OPEN, FETCH (including scrollable cursors) and CLOSE of a declared cursor use the rows you typed. Not supported yet, and stopped with a message: SORT of a table, MERGE, SORT with COLLATING SEQUENCE, recursive CALLs, CALL USING ADDRESS OF, and floating-point literals or numeric literals BY REFERENCE as CALL arguments (a numeric literal BY CONTENT is passed as a zoned DISPLAY item). Anything else is reported, never guessed.
Variables
Press START to see every field and its bytes.
What happened
How close is it to z/OS? Field sizes, packed and zoned bytes, MOVE and editing rules follow IBM Enterprise COBOL. The S0C7 check follows what the hardware does in decimal arithmetic; whether a given program abends can still depend on compiler options such as NUMPROC. Fields without a VALUE start as X'00' here. Intermediate results are kept exact, so a final digit can differ where IBM's intermediate-precision rules round differently.
ACCURACY · SIMULATION · CONFIRM ON Z/OS
A simulation that follows Enterprise COBOL rules, checked by two independent reviews and tests. Results can depend on compiler options, and Db2 and CICS results are the ones you type in. Confirm on z/OS.
Check it yourself in one minute
- Open your browser's developer tools: in Chrome or Edge press F12 or right-click and choose Inspect; in Firefox press Ctrl+Shift+E for the Network Monitor; in Safari first turn on Show features for web developers under Settings, Advanced. Then open the Network tab.
- Keep the log across page loads (Chrome: Preserve log; Firefox: Persist Logs), then use the tool: paste your text or open a file and press the button.
- Look at the list. You will see only this page and its own files, loaded when the page opened. Nothing new appears when you use the tool.
- Still unsure? Switch Wi-Fi off and try again. The tool still works.
What the badge counts: requests the browser logged after this page finished loading, other than the site's own files. It reads the browser's own record and makes no request of its own. If your browser cannot give that record, the badge says so. The badge is a convenience; the developer tools are the proof.
The rule that enforces it
Every page carries this Content Security Policy. The browser itself refuses any request outside it; connect-src 'none' blocks fetch, XHR and WebSocket.
default-src 'none';
script-src 'self';
style-src 'self';
img-src 'self' data:;
font-src 'self';
connect-src 'none';
object-src 'none';
form-action 'none';
base-uri 'none';
manifest-src 'self';
worker-src 'self'Suggest a tool or report a wrong answer · How it works and why it is safe
No mail app opens? Write to hello@mainframepath.com . Please do not send confidential code or data.