VX/COBOL is a full-featured VMS / OpenVMS COBOL to ANSI COBOL Compiler/Transpiler®. VX/COBOL allows VMS / OpenVMS COBOL source code to be compiled on Linux and multiple host machines. The application can be maintained in the original COBOL language or can be switched over to Linux ANSI COBOL Development Environments. VX/COBOL will convert 100% of supported VMS / OpenVMS COBOL syntax and Semantics to working COBOL (Fujitsu or Micro Focus).
Many of our Cobol clients have indicated that they wanted to see "Less Words" more "Examples" so, we've tried to strike a balance between Examples and keeping this site "Google Mobile [Responsive] Friendly"
VX/COBOL is an advanced utility that reads VMS / OpenVMS COBOL sources and rewrites these seamlessly as ANSI COBOL.
This processing can happen as part of the build process: continue developing and maintaining the original VMS / OpenVMS COBOL sources, leverage expertise of current developers, without disrupting the current development environment.
Current sources, directory layout, and logical controls for development, testing, and production are retained. Provide production Linux deployment of native executables and applications built from current VMS / OpenVMS sources.
VX/COBOL has proven its capabilities hundres of times, effortlessly converting code based of 8 Million to 12 Million lines of coBOL.
VX/COBOL is part of the Continuous Integration initiative and has been certified by Sector7 as "CI Capable".
VX/COBOL is so complete that entire IT departments continue to develop on VMS / OpenVMS COBOL and get release after release into production, at the same time, when each release is "pushed" the CI VX/COBOL : Translated all the COBOL from scratch, compiles all the cobol, links all the cobol, then run autoamted test sutes. The migration to Linux is simplh "part of the VMS / OpenVMS Development Cycle".
VX/COBOL is a mature product that detects and fixes problems that you'll never even know existed until you have prodution code issues.
VX/COBOL produces code that does not depend on any COBOL helper libraries beyond an external file handler specific to the chosen compiler; the generated code is pure COBOL
IItemlists can be problematic when written on 32bit VMS / OpenVMS COBOL but used on 64bit ANSI COBOL. For a 32-bit itemlist, the pointer elements may be defined as 32-bit numeric types. These need to be changed to pointer types in order to work with the VXRT runtime.
The VXRT runtime routines will recognize 32 and 64 bit itemlist formats, however 64-bit pointer space must be provided by the COBOL compiler. Changing the type to pointer will compile the space properly.
VMS / OpenVMS COBOL
ANSI COBOL
01 ITEM_LIST.
05 FILLER PIC S9(04) COMP VALUE 9.
05 FILLER PIC S9(04) COMP VALUE 134.
05 ANON_POINTER_003 POINTER VALUE NULL.
05 FILLER POINTER VALUE NULL.
This code is added to the initialization paragraph:
Copy statements for using CDD Dictionary and copybooks with logical names are modified to conform to ANSI COBOL.
By default, VX/COBOL will expand all COPY files into a single source file. Source changes are made by VX/COBOL acting as a preprocessor for all inputs.
Used this way, VX/COBOL can always take as input the latest sources from VMS / OpenVMS and these can be maintained as VMS / OpenVMS COBOL using current development staff with no retraining. This default behavior allows the VMS / OpenVMS COBOL to be maintained on VMS / OpenVMS or on Linux indefinitely.
Alternatively, the -Xc option will have VX/COBOL rewrite the source files out as their ANSI COBOL counterparts. This option allows the resulting ANSI COBOL to be maintained on the target Linux system thereafter.
Normally, all COPY modules are expanded into the generated source, such that the new file is one large source file with no COPY modules.
This switch disables the expansion, leaving the COPY statement, with the specified Net COBOL conversions. Each COPY module file is translated into a new file with the same base name of the module file and the extension NEW. These new modules are placed into the folder specified by the environment variable XPP_MODULE_DIR. If this variable is not defined, a warning is given and no new module files are created.
Each division, sections and declarations modified to confirm to ANSI COBOL include:
VMS / OpenVMS COBOL allows initialization of pointer as reference to another variable. ANSI COBOL does not allow reference to be used in pointer initialization.
Pointers cannot be initialized with a reference to another variable. The initialization is changed to be NULL and a MOVE statement is issued in a /s7/INIT paragraph that is appended at the end of the program. A perform of this /s7/INIT paragraph is added at the beginning of the program. Nameless pointers are assigned a new name of ANON_POINTER_nnn with nnn incrementing from 001.
VMS / OpenVMS
ANSI COBOL
The following code is inserted in the PROCEDURE DIVISION:
Some Examples of VMS / OpenVMS COBOL to ANSI COBOL
VERBS Changed by VX/COBOL to ANSI Functional Equivalents
ACCEPT | ADD | ALTER | CALL |
CANCEL | CLOSE | COMPUTE | CONTINUE |
DELETE | DISPLAY | DIVIDE | EVALUATE |
EXEC | EXIT | GENERATE | GO |
IF | INITIALIZE | INITIATE | INSPECT |
MOVE | MULTIPLY | OPEN | PERFORM |
READ | RELEASE | REPLACE | RETURN |
REWRITE | SEARCH | SET | SORT |
START | STOP RUN | STRING | SUBTRACT |
SUPPRESS | TERMINATE | UNLOCK | UNSTRING |
USE | WRITE |
The text "+ /s7/PREC" is appended to any COMPUTE statement that has a divide "/" operation because of NetCOBOL computational differences.
VMS / OpenVMS COBOL
HP VMS / OpenVMS uses an intermediate data area for arithmetic operations. In The Rounding Phrase the intermediate data item always contains 31 digits of precision, with the rounding performed on the final move to the resultant variable.
The NetCobol manual also talks about arithmetic operations and an intermediate result which contains the results of operations. NetCOBOL V10.4 Language Reference Page 258 section 6.3.6 Arithmetic Statements Page 259 section 6.3.8 ROUNDED Phrase Page 675 Appendix D Intermediate Results with focus on D.2.1 Fixed Point The intermediate data item contains the maximum digits seen from all operands in the statement.
By adding a zero with 5 decimal precision provides sufficient decimal places for most computations to be correct. Note that COBPP does not compute the decimal usage of data elements. Therefore a COBOL source could have data elements defined with large decimal places. SourceFile nnn: JMN3024I-W The intermediate result cannot contain more than 30 digits. The intermediate result is assumed to have 30 digits. SourceFile nnn: JMN3024I-W The intermediate result cannot contain more than 30 digits. The intermediate result is assumed to have 30 digits.
STATISTICS:
HIGHEST SEVERITY CODE=W,
PROGRAM UNIT=1
COMPUTE WS_AVG_CPH = ((((WS_AVG_MPT *
(COST_AVG_HBM * COST_AVG_HC))
+
(WS_AVG_NH * COST_AH)) / WS_AVG_NH)
/ (WS_COST_TF / COST_AVG_HC)) + /s7/PREC
01 WS_AVG_CPH PIC 9(08)V9999.
01 WS_AM PIC 9(08)V9999.
01 WS_COST_TF PIC 9(04)V9999.
01 WS_AVG_NH PIC 9(08)V9999.
05 COST_AVG_HBM PIC 9(04)V9999.
05 COST_AVG_HC PIC 9(04)V9999.
05 COST_AH PIC 9(04)V99.
I-O-CONTROL (A subset of examples)
VMS / OpenVMS uses the APPLY LOCK HOLDING statement to set file locking characteristics. ANSI COBOL uses LOCK MODE on the SELECT statement.
For each file listed in the APPLY LOCK HOLDING statement, the clause LOCK MODE IS AUTOMATIC is added in the FILE-CONTROL paragraph on the SELECT statement for that file.
The APPLY LOCK HOLDING statement is made into a comment.
VMS / OpenVMS COBOL
ANSI COBOL
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OPTIONAL CUST_FILE ASSIGN TO "CUST,EXFH"
ORGANIZATION IS INDEXED
FILE STATUS IS FILE_STATUS_BYTE
ACCESS IS DYNAMIC
RECORD KEY IS CUST_KEY
ALTERNATE RECORD KEY IS CUST_ALPHA_CODE
ALOCK MODE IS AUTOMATIC.
CALL
The word GIVING is replaced with RETURNING. Parameters that are missing or given as OMITTED are replaced with BY VALUE 0.The procedure name is shifted to lower-case to match program-ids that are also shifted (see rule S.1.1).
VMS / OpenVMS COBOL
ANSI COBOL
Net COBOL does not support parameters passed by descriptor. Therefore a temporary 64-bit descriptor is created and passed by reference. Because this involves multiple MOVE and COMPUTE statements, besides the CALL, all these statements are placed inside a PERFORM block.
ANSI COBOL
LITERALS AND OPERATORS
Literals
VMS / OpenVMS COBOL allows literals to be empty. ANSI COBOL requires literals to have a value.
Quoted strings must:
VMS / OpenVMS COBOL
ANSI (Net COBOL)
Net COBOL will give compile errors on strings that are greater than 160 characters, and compile warnings for strings that contain a tab character.
Operators
VMS / OpenVMS COBOL does not require a space between operators or around literals. ANSI COBOL does require a space between operators, words, or literals.
Addition | |
- | Subtraction |
* | Multiplication |
/ | Division |
= | Equal or Assignment |
** | Exponentiation |
> | Greater Than |
≥ | Greater Than Or Equal To |
< | Less Than Or Equal To |
≤ | Less Than Or Equal To |
, | Comma |
VMS / OpenVMS COBOL
ANSI COBOL
MOVE "-" TO V1, V2, V3
STRING "PRO_NUMBER", ",", "EXCEPTION_REASON"
IF TEST_FLAG = "Y"
PERFORM UNTIL (WS_DONE = "Y" OR WS_COUNT = 1)
MOVE TABLE(IDX, 1) TO SMALL_TABLE(IDX, 1)
IF (TABLE(IDX) NOT = 0)
COMPUTE TTL = A_SHIP + B_SHIP
COMPUTE TTL = (C_RECS(IDX, 3) /
T_RECS(IDX, 4)) * 100