Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

VX/COBOL – OpenVMS COBOL to ANSI COBOL

Overview

VX/COBOL is a source-to-source translator that rewrites VMS and OpenVMS COBOL into ANSI-compliant COBOL, so existing applications compile and run on x86 Linux with no manual code changes. The translation happens at compile time: VX/COBOL emits standard COBOL text, which the target compiler then builds. Both Fujitsu NetCOBOL and Micro Focus COBOL are supported, and the original program logic and structure are preserved.

VX/COBOL is built for continuous integration. Teams keep developing in VMS and OpenVMS COBOL while each release is migrated to Linux automatically, so there is no code freeze during a long project. File handling is covered end to end by VX/RMS, and a companion runtime library supplies the callable helpers the emitted code depends on, so record access, descriptors, and OpenVMS system service calls behave the same on Linux as they did on OpenVMS.

Translation model and pipeline

VX/COBOL is a compiler front end and emitter, plus a linked runtime library. It is not a runtime emulator: the translation is done at compile time, so VX/COBOL reads OpenVMS COBOL and writes ordinary ANSI COBOL text, which Fujitsu NetCOBOL or Micro Focus COBOL then compiles into a Linux executable. Source moves through a fixed set of stages, each building on a typed model of the program rather than doing text substitution.

StageRole
Source formatHandles terminal and ANSI reference formats, column stripping, comment lifting, and conditional-compilation directives.
LexerTokenises the source stream, including VSI hexadecimal literals with their permitted whitespace.
ParserRecursive-descent parser with a Pratt expression parser that builds a typed abstract syntax tree.
PICTURE analysisCategorises every PIC clause: numeric, edited, or alphanumeric, with scale and sign.
COPY and CDDExpands COPY and REPLACING pseudo-text and resolves COPY ... FROM DICTIONARY against a Common Data Dictionary.
EXEC scanSurfaces EXEC SQL, ACMS, and CICS verbs and their host-variable references.
ResolverBuilds the symbol table and resolves qualification, subscripts, and REDEFINES.
EmitterPretty-prints the abstract syntax tree as ANSI COBOL and applies the transformation rules.
Compile-time, not runtime. VX/COBOL emits standard COBOL source, so the output is ordinary code the mainstream NetCOBOL and Micro Focus toolchains build, debug, and profile. A separate runtime library, together with VX/RMS, supplies the callable helpers the emitted code links against.

Pipeline

Input
OpenVMS COBOL.cob source or .lib copy library
01Source formatNormalises the OpenVMS COBOL source format for processing.
02LexerTokenises the normalised source stream.
03ParserBuilds the typed program model from the token stream.
04ResolverResolves symbols, qualification, subscripts, and data relationships.
05EmitterWrites ANSI COBOL as .cob source plus a per-file .log.
06Target compilerNetCOBOL or Micro Focus COBOL compiles the emitted ANSI COBOL.
Output
x86 Linux executableNative binary built from the translated ANSI COBOL

Input file types

ExtensionMeaning
.cobCOBOL source.
.libCOBOL copy library.
.pcoOracle Pro*COBOL source; processed by the Pro*COBOL precompiler after VX/COBOL runs.
.flgFMS form file, compiled to its binary form by the FMS tooling.

Source dialect coverage

VX/COBOL parses the OpenVMS and VSI COBOL dialect into a typed model, so it understands the constructs a real estate uses rather than passing them through as text. The matrix below tracks coverage against the VSI COBOL reference language and groups each area into a support bucket. The great majority of the language is fully typed and live; the remaining gaps are narrow and named.

Language areaSupport
IDENTIFICATION and ENVIRONMENT divisions (PROGRAM-ID, COMMON/INITIAL/RECURSIVE, OPTIONS ARITHMETIC)live
SPECIAL-NAMES (DECIMAL-POINT, CURRENCY, ALPHABET, CLASS, SYMBOLIC, switches, mnemonics)live
FILE-CONTROL / SELECT (organization, access mode, keys, FILE STATUS, LOCK MODE, RESERVE, CODE-SET)live
I-O-CONTROL (SAME AREA, MULTIPLE FILE, RERUN, APPLY LOCK-HOLDING)live
FD and SD clauses (BLOCK/RECORD CONTAINS, LABEL, VALUE OF ID, LINAGE, CODE-SET)live
Data description (PIC, USAGE, VALUE, OCCURS, REDEFINES, RENAMES, 88-level, SIGN, SYNC, JUST)live
USAGE variants (DISPLAY, COMP-1 through COMP-6, COMP-X, PACKED-DECIMAL, INDEX, POINTER, POINTER-64, NATIONAL)live
78-level constants and ANY LENGTH itemslive
Report Section and Screen Section descriptionslive
Procedure verbs (the 30 fully typed statements from ACCEPT through WRITE)live
INSPECT, SET (all forms), and REPLACElive
Conditions (relation, class, sign, 88-level, combined, VSI SUCCESS/FAILURE)live
Expressions (intrinsics, reference modification, qualification, subscripts, special registers)live
COPY, CDD, and REPLACE (including COPY FROM DICTIONARY and SUPPRESS)live
EXEC SQL, ACMS, and CICS bodies (verb and host variables scanned; body passed through)v1 soon
Report descriptor NEXT GROUP and a handful of verb sub-phrasesv1 soon
TYPEDEF and TYPE (VSI typed-data extension)v2
Screen Section ERASE, BLANK REMAINDER, PROMPT, and SIZE clausesv2
OOP COBOL structural units (CLASS-ID, METHOD-ID, FACTORY, REPOSITORY)out of scope
Communication Section and CD entriesout of scope
Named gaps, not silent ones. Any construct the translator cannot fully represent is counted and named in the per-file log rather than dropped. The surviving structural gaps are OOP COBOL units, structured EXEC SQL prepared statements, the Communication Section, and the TYPEDEF/TYPE extension.

Transformation rules

The emitter applies a catalogue of transformation rules, grouped by division and phase so each change is traceable. The families below cover everything from lexical spelling through system-service calls and an optional directed-changes file. The counts show how much of each area is handled automatically.

FamilyFocusRules
Lexical and identifiersSpelling, casing, name length, reserved-word collisions10
IdentificationPROGRAM-ID handling and recursion2
EnvironmentConfiguration headers, file assignment, locking, sequential organization7
Data divisionUsage, pointers, descriptors, runtime copybooks, RMS registers17
Procedure divisionStatement rewrites, precision, initialisation, file verbs29
CALL and system servicesArgument modes, padding, SYS$ to COB$ remapping10
EXEC SQL and Pro*COBOLEmbedded SQL name and include rewrites10
Runtime copybooksInjected working-storage support modules7
Directed changesOptional control-file directives that override heuristics16

Identifiers and lexical

  • Comment indicators (*, /, !) become the inline form *>, leaving the comment text untouched.
  • Identifiers and reserved words are upper-cased, and a hyphen inside a name becomes an underscore.
  • Names longer than 30 characters are truncated to fit the ANSI limit.
  • A $ inside an identifier becomes x (configurable), but this substitution never applies inside a CALL literal.
  • A user name that collides with a NetCOBOL reserved word gets an _R suffix.
  • VALUE EXTERNAL symbols are resolved to compile-time constants instead of link-time symbols.

Environment and file control

  • APPLY LOCK-HOLDING in I-O-CONTROL is commented out, and each listed file gains LOCK MODE IS AUTOMATIC on its SELECT.
  • ORGANIZATION IS SEQUENTIAL becomes LINE SEQUENTIAL for non-indexed, non-relative files.
  • Indexed files pick up the external file handler suffix on their ASSIGN TO so record access routes through the runtime.
  • Missing CONFIGURATION SECTION and SPECIAL-NAMES headers are inserted where the target compiler requires them.

Data division

  • COMP, COMP-1 through COMP-6, COMP-X, and BINARY are normalised to COMP-5.
  • POINTER VALUE REFERENCE, which NetCOBOL rejects, becomes POINTER VALUE NULL plus a MOVE FUNCTION ADDR(...) in a generated init section.
  • 32-bit descriptors are widened for 64-bit builds, and 64-bit pointers stored as PIC S9(9) COMP become POINTER.
  • Four runtime support copybooks are injected at the top of WORKING-STORAGE, along with a version marker.
  • RMS special-register structures are emitted per file so status and filename registers are available.

Procedure division

  • PROCEDURE DIVISION ... GIVING becomes ... RETURNING, paired with a generated return item.
  • A COMPUTE that contains a division gets a precision term appended, preserving VSI intermediate precision.
  • STOP RUN becomes MOVE 0 TO PROGRAM-STATUS followed by EXIT PROGRAM.
  • OPEN, READ, WRITE, and START drop ALLOWING and REGARDLESS clauses; REGARDLESS OF LOCK becomes WITH NO LOCK.
  • SET p TO REFERENCE OF v becomes MOVE FUNCTION ADDR(v) TO p.

CALL and system services

  • GIVING on a CALL becomes RETURNING, and each OMITTED argument becomes BY VALUE 0.
  • The CALL literal name is passed verbatim, so a literal such as CALL "ACMS$SIGN_IN" is left unchanged.
  • BY DESCRIPTOR arguments are emitted as 64-bit OpenVMS string descriptors.
  • Arguments are padded with BY VALUE 0 to each callee's expected count, using a built-in routine table.
  • Item-list bearing SYS$ services are renamed to their COB$ counterparts (15 services) so a 64-bit-aware implementation is called.

Directed changes

An optional control file lets a migration override the translator's heuristics without touching source. Directives cover recursive programs, external file handler on and off, external and pointer definitions, descriptor sizing, the dollar-sign replacement character, dash preservation in file, procedure, and label names, and database copybook injection. Unrecognised directives are skipped rather than treated as errors.

Before and after

These worked examples show the translator rewriting real OpenVMS COBOL constructs into ANSI COBOL. The identifiers use a banking demo estate; the syntax is exactly what VX/COBOL emits.

CALL rewrite: RETURNING, BY VALUE, and SYS$ to COB$

A system-service call using GIVING, OMITTED arguments, and an item-list service:

PROCEDURE DIVISION.
MAIN.
    CALL "SYS$GETJPIW" USING
        BY VALUE EFN
        BY REFERENCE PID
        OMITTED
        BY REFERENCE ITEM-LIST
        BY REFERENCE IO-STATUS
        OMITTED
        OMITTED
        GIVING RET-STATUS
    STOP RUN.

becomes:

PROCEDURE DIVISION.
MAIN.
    CALL "COB$GETJPIW" USING
        BY VALUE EFN
        BY REFERENCE PID
        BY VALUE 0
        BY REFERENCE ITEM-LIST
        BY REFERENCE IO-STATUS
        BY VALUE 0
        BY VALUE 0
        RETURNING RET-STATUS
    *> STOP RUN lowered to MOVE 0 TO PROGRAM-STATUS + EXIT PROGRAM

The item-list service SYS$GETJPIW is remapped to COB$GETJPIW, GIVING becomes RETURNING, and every OMITTED argument becomes BY VALUE 0 so the argument positions stay correct.

COMPUTE precision on division

COMPUTE FEE-PCT ROUNDED = (FEE-AMT / TOTAL-AMT) * 100
COMPUTE GROSS-AMT = FEE-AMT + TOTAL-AMT

becomes:

COMPUTE FEE-PCT ROUNDED = (FEE-AMT / TOTAL-AMT) * 100 + S7_PREC
COMPUTE GROSS-AMT = FEE-AMT + TOTAL-AMT

Only the statement that contains a division gets the precision term appended, matching the VSI intermediate-precision behaviour. The division-free COMPUTE is left as is.

Indexed file assignment

SELECT ACCOUNT-FILE ASSIGN TO "ACCOUNTS.DAT"
    ORGANIZATION IS INDEXED
    ACCESS MODE IS DYNAMIC
    RECORD KEY IS ACCT-ID.
SELECT AUDIT-FILE ASSIGN TO "AUDIT.LOG".

becomes:

SELECT ACCOUNT-FILE ASSIGN TO "ACCOUNTS.DAT,EXFH"
    ORGANIZATION IS INDEXED
    ACCESS MODE IS DYNAMIC
    RECORD KEY IS ACCT-ID.
SELECT AUDIT-FILE ASSIGN TO "AUDIT.LOG".

The indexed file routes through the external file handler, so VX/RMS performs the record access; the non-indexed audit file is left unchanged.

File locking

I-O-CONTROL.
    APPLY LOCK-HOLDING ON ACCOUNT-FILE.

becomes:

*> APPLY LOCK-HOLDING ON ACCOUNT-FILE
*> relocated as LOCK MODE IS AUTOMATIC on the ACCOUNT-FILE SELECT
    SELECT ACCOUNT-FILE ASSIGN TO "ACCOUNTS.DAT,EXFH"
        LOCK MODE IS AUTOMATIC
        ORGANIZATION IS INDEXED.

Record-locking intent carries over without manual rework: the OpenVMS APPLY LOCK-HOLDING clause is dropped from I-O-CONTROL and the file picks up LOCK MODE IS AUTOMATIC in FILE-CONTROL.

Runtime library and copybooks

The emitted ANSI COBOL links against a Sector7 runtime that provides the OpenVMS behaviour the source relied on. Four support copybooks are injected at the top of WORKING-STORAGE, and together they form the contract between the migrated program and the runtime.

CopybookContents
Data typesSigned and unsigned 16, 32, and 64-bit type definitions, plus the 64-bit descriptor and item-list layouts.
DescriptorsFixed-capacity literal, descriptor, numeric-descriptor, and pointer arrays used to marshal call arguments.
Item listsThe 64-bit item-list array used by remapped item-list system services.
ConstantsSuccess and failure constants, the precision constant, display and status helpers, and the external file handler suffix.
SQLCAThe Oracle SQLCA layout that replaces the VSI SQLCA include on the embedded-SQL path.
Fixed-capacity marshalling. The descriptor and item-list arrays have set capacities sized to the constructs seen in production estates. A single call needing more descriptor slots than the array provides is reported rather than silently truncated.

File I/O and RMS

File operations route through VX/RMS, so OPEN, READ, WRITE, REWRITE, DELETE, START, and CLOSE behave identically to OpenVMS RMS. The runtime keeps each file's last RMS status so the RMS status special registers work as before, and record locking follows the LOCK MODE IS AUTOMATIC relocation applied during translation.

System services

OpenVMS system service and run-time library calls resolve against the runtime rather than the VMS executive. Item-list services are remapped to their COB$ counterparts, argument descriptors are built in the 64-bit layout, and the run-time library entry points provide the same signatures and status conventions the original code expects.

Compilers, targets, and compatibility

VX/COBOL produces ANSI COBOL for the two mainstream COBOL compilers on Linux and preserves the OpenVMS behaviours that applications depend on. The matrix summarises what is supported and where each capability stands.

CapabilitySupport
Target compilers: Fujitsu NetCOBOL and Micro Focus COBOLlive
Target platform: x86 Linuxlive
32-bit and 64-bit architecture differences adjusted automaticallylive
OpenVMS RMS file handling through VX/RMSlive
OpenVMS system services and run-time library via the COB$ runtimelive
Embedded SQL for Rdb and Oracle through the EXEC SQL and Pro*COBOL pathv1 soon

Continuous integration without a code freeze

Because conversion is fully automated, a team keeps developing in VMS and OpenVMS COBOL while each release is translated to Linux on demand. There is no code freeze during a long migration, and functionality is preserved across the estate. Large applications of several million lines convert in minutes, so the migrated build can track the OpenVMS source release by release.

How this differs from an emulator or a rewrite

VX/COBOL is neither a hand rewrite nor a runtime emulator. It is a compile-time translator that emits ordinary ANSI COBOL, so the result is standard source that NetCOBOL or Micro Focus builds, and developers can read, debug, and maintain the output with mainstream tools. Every transformation is recorded in a per-file log, and any construct the translator cannot represent is named rather than dropped, so the migration is auditable rather than a black box.

Quick reference

Pipeline

source format → lexer → parser → resolver → emitter, then compile the emitted ANSI COBOL with NetCOBOL or Micro Focus.

1. Translate: OpenVMS COBOL in, ANSI COBOL out (plus a per-file .log)
source.cob   ->   source.cob (ANSI) + source.log

2. Compile the emitted ANSI COBOL with NetCOBOL
cobol -dy -i COBOL.OPT -c source.cob

Signature transforms to remember

OpenVMS COBOLANSI COBOL
GIVINGRETURNING
OMITTEDBY VALUE 0
COMP, COMP-1..6, COMP-X, BINARYCOMP-5
ORGANIZATION IS SEQUENTIALLINE SEQUENTIAL
APPLY LOCK-HOLDINGLOCK MODE IS AUTOMATIC
$ in an identifierx (not inside a CALL literal)
Item-list SYS$ servicesCOB$ counterparts (15 services)
COMPUTE with divisionprecision term appended

Rule families

Lexical: 10
Identification: 2
Environment: 7
Data: 17
Procedure: 29
CALL / services: 10
EXEC SQL: 10
Copybooks: 7
Directed changes: 16

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

What is the percentage of translation for OpenVMS COBOL to NetCOBOL, for example?

VX/COBOL translates OpenVMS COBOL to ANSI COBOL automatically, with no manual code changes. What is more important is that there are no fixes required, post-translation.

How long does it take to automatically convert 5 million lines of OpenVMS COBOL to ANSI COBOL?

The translation is done on Linux at compile time and is automatic. The time depends on the size and complexity of the application, so we give you an estimate for your own code as part of the assessment process.

How do you test the translated code?

Immediately after the translation is performed, the translated code is compiled on Linux using Fujitsu NetCOBOL or Micro Focus COBOL. These Linux-based compilers are really fast. Testing then follows a test plan agreed with you: see the value of testing in a migration project.

Our OpenVMS application makes use of multiple System Services. How do you support that?

Sector7 has an extensive library of these services running on Linux to perform the same functions as on OpenVMS.  our language conversion tools will adapt the arguments in the procedure API to work with this library.  For instance, VX/COBOL or VX/FORTRAN etc will transform the argument passed BY DESCRIPTOR to a method that will work on Linux.

When the code is compiled on Linux, the compiled objects are linked with the Sector7 library of system services and the program executes on Linux just as it does on OpenVMS, making full use of the various system services.

The critical point here is that there is no need to touch the original source code, the Sector7 tools do all the work.

What is VX/COBOL and how does it help businesses?

VX/COBOL is a comprehensive solution designed to migrate OpenVMS COBOL applications to modern, flexible Linux-based systems. It is a source-to-source translator: it reads VMS and OpenVMS COBOL and emits standard ANSI COBOL, which Fujitsu NetCOBOL or Micro Focus COBOL then builds on x86 Linux. Your valuable, time-tested business logic is retained without rewriting code from scratch, and the original program logic and structure are preserved.

To discover how we can help you, please contact us.

What kind of testing support does VX/COBOL provide?

VX/COBOL emits standard COBOL, so the translated application is built, debugged and profiled with the ordinary Fujitsu NetCOBOL or Micro Focus COBOL toolchains on Linux. Testing is how we confirm functional equivalence: we validate the OpenVMS baseline, then run the same test plan against the migrated application before it goes live.

To learn more about our testing methodologies, read the value of testing in a migration project or contact us.

What does VX/COBOL convert, and where does the result run?

VX/COBOL automatically converts VMS and OpenVMS COBOL to ANSI-compliant COBOL so the application runs on x86 Linux with no manual code changes. The converted code targets the Fujitsu NetCOBOL and Micro Focus COBOL compilers, and the original COBOL logic and structure are preserved.

Does VX/COBOL require rewriting our existing COBOL code?

No. VX/COBOL is a source-to-source translator that does the conversion automatically, so teams do not rewrite their COBOL by hand. It reads OpenVMS COBOL and emits standard ANSI COBOL that Fujitsu NetCOBOL or Micro Focus then compiles on Linux.

How does VX/COBOL handle OpenVMS pointers initialized by reference?

VMS and OpenVMS can initialize a pointer by reference, which ANSI COBOL does not allow. VX/COBOL changes the initialization to a null value and generates a MOVE FUNCTION ADDR statement in an init section, so the pointer is set up correctly in the PROCEDURE DIVISION without any manual editing.

How are CALL statements changed during migration?

VX/COBOL replaces GIVING with RETURNING, converts each OMITTED argument to BY VALUE 0, and for known item-list system services renames the callee to its COB$ runtime counterpart. All of this is automatic, so the calling code does not need manual editing.

Can we keep developing in OpenVMS COBOL while the migration is underway?

Yes. VX/COBOL is built for continuous integration: you keep developing in VMS and OpenVMS COBOL, and each release is migrated to Linux automatically, so there is no code freeze and full functionality is preserved across the estate.

How are RMS file operations supported after migration to Linux?

VX/COBOL routes file operations through VX/RMS, so RMS file handling carries over to Linux. Programs keep their VMS file organizations, access modes, record formats, and locking behaviour, and per-file RMS status is preserved for the status special registers.

Does VX/COBOL account for 32-bit and 64-bit architecture differences?

Yes. As part of targeting Linux, VX/COBOL adjusts for 32-bit and 64-bit architecture differences, widening descriptors and converting stored pointers where needed, so the migrated application behaves correctly on x86 Linux.

How is OpenVMS file locking (APPLY LOCK-HOLDING) migrated?

VX/COBOL drops the OpenVMS APPLY LOCK-HOLDING clause from I-O-CONTROL and instead adds LOCK MODE IS AUTOMATIC to the affected file's SELECT in FILE-CONTROL, so record-locking behavior carries over without manual rework.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.