z390 Portable Mainframe COBOL Compiler

zCOBOL NIST COBOL 1985 Test Results

z390 Portable Mainframe Assembler and Emulator
 

zCOBOL Docs

Overview

The NIST COBOL Tests have been downloaded and are being used as an initial test of zcobol compliance with the COBOL 1985 Standard.  There are 459 COBOL test programs of which 409 are currently being tested with zcobol.  See the summary statistics showing translation, assembly, and execution by 2 character program name prefix.  Currently they all translate without errors. 

See the translation statistics showing the frequency of each generated zcobol macro call listed in descending order by frequency followed by alphabetical list.  The zcobol translator program zc390.java/class in z390.jar consists of 1625 lines of java code and uses regular expression parsing support to translate COBOL programs into equivalent HLASM compatible macro assembler calls.  It's interesting to note that out of about 440,000 lines of COBOL code, the following make up over 80% of all verbs: PERIOD, MOVE, WS, PERFORM, LABEL, GO, IF, ADD, ELSE, and EXIT.  PERIOD is the name of the macro generated to process end of sentence closing structures etc.  WS is the name of the generated macro to handle all data definitions in working-storage and linkage section with unique qualified names.  LABEL is the generated macro to handle creating unique qualified paragraph names.  The translator also maps dashes in names to underscores, double quotes to single quotes, START to ZCSTART, and END DECLARATIVES to END_DECLARATIVES to avoid assembler conflicts.

See the Generated HLASM Assembler Instructions showing the frequency of each generated HLASM assembler instruction listed in descending order by frequency followed by alphabetical list.  The zcobol directory currently contains 119 macros corresponding to COBOL verbs and reserved section names plus 9copybooks totaling 7470 lines of conditional structured macro code.  The zcobol directory macros in turn call code generation macros for the target language environment.  The zcobol\z390 directory contains 44 code generation macros and 4 copybooks totaling 13,250 lines of conditional structured macro code.  Of the million plus lines of generated HLASM assembler code generated, over 80% consist of the following: DS, LARL, EQU, L, MVC, BASR, DC, MVI, LAY, USING, ORG, DROP, and BRC.  The LARL is used to address single literal pool without requiring base register.

Much work has been done and the zcobol compiler does compile and execute programs including a number of EXEC CICS COBOL programs and also a number of demo and zcobol regression test COBOL programs.  However, there is still much work to do to complete the NIST COBOL 1985 test suite.  See the pending priority list here and join the zcobol user email group to participate in future direction of zcobol and the setting of priorities going forward.

The HLASM generation macros could now be copied to other target language directories for Java, C, and MASM and then modified to generate the appropriate equivalent source code.  However, the current focus will remain on HLASM and since the zcobol generic language macros which call the code generation macros are still subject to change, delaying the start of other target language macro libraries is recommended.  There are existing example generation macros already included which support compiling the zcobol\demo\HELLO.CBL program into executable J2SE Java, Microsoft Visual C, and Intel MASM assembler.
 

Summary Statistics

The following summary report shows the current progress toward translating, assembling, and executing 409 NIST test programs for COBOL 1985 using zcobol and z390 version v1.5.01.  This report was generated automatically using the following set of ZPAR utility commands:

call zpar\ZPARGEN zpar\ZCCLG \work\nist\src\*.CBL
call zpar\ZPARSUM2                     \work\nist\src\*.ERR

         TRANSLATE  ASSEMBLY         EXECUTION
ID  TOT  RC=0 RC>0  RC<=4 RC=8 RC>8  RC=0 RC>0 

CM    7     7    0      0    7    0     0    0
DB   10    10    0      0   10    0     0    0
EX    1     1    0      0    1    0     0    0
IC   35    35    0     26    9    0     7    7
IF   42    42    0      0   42    0     0    0
IX   38    38    0      0   38    0     0    0
NC   92    92    0     18   72    0     2   18
OB    9     9    0      3    6    0     0    2
RL   32    32    0      0   32    0     0    0
RW    4     4    0      0    4    0     0    0
SG   10    10    0      0   10    0     0    0
SM    7     7    0      1    6    0     0    1
SQ   82    82    0      0   82    0     0    0
ST   39    39    0      0   39    0     0    0 

**  408   408    0     48  358    0     9   28

Notes:

  1. The total NIST COBOL 1985 test suite includes 459 programs.

  2. SM201A and SM206A have been removed pending completion of RPI 1068 support for split pseudo literal for COPY REPLACING.

  3. IC223a thru IC237A (11) have been removed pending RPI 1070 to add support for batch compiles from single CBL source with END PROGRAM statements.

  4. Removed 31 programs of the form IDNNNM which intentionally raise flags to test for error checking.

  5. Remove SM201A through SM208A until RPI 1006 is implemented to support the REPLACE verb.

  6. All of the remaining 408 programs translate and assemble without any abnormal terminations in 30 minutes which is an average of about 4 seconds per program on Dell 3 GHZ duo core Windows Vista system..

  7. The next step will be to add missing functions identified by MNOTE's in order to assemble and execute successfully.

Translation to zcobol Macro Calls

All of the generated MLC files for the 409 NIST COBOL programs were read to produce this report using the command:

zpar\ZPARMLC \work\NIST\SRC\*.MLC

G3-ZPARMLC TOTAL OPCODES = 99
G3-ZPARMLC TOTAL LINES = 777169
G3-ZPARMLC CURRENT DATE=08/22/09 TIME=06.11
G3-FREQ--- OPCODE
G2 339044 @_COMMENT
G2 129509 PERIOD
G2 78200 MOVE
G2 70231 WS
G2 46035 PERFORM
G2 43839 LABEL
G2 20826 GO
G2 14095 IF
G2 7932 ADD
G2 5752 ELSE
G2 2053 EXIT
G2 1717 WRITE
G2 1198 CLOSE
G2 1196 OPEN
G2 997 READ
G2 932 SET
G2 932 DATA
G2 917 PROCEDURE
G2 883 SELECT
G2 842 FD
G2 661 COMPUTE
G2 487 STOP
G2 474 END
G2 466 IDENTIFICATION
G2 462 ENVIRONMENT
G2 451 ZCOBOL
G2 451 PROGRAM_ID
G2 451 CONFIGURATION
G2 427 FILE
G2 422 INPUT_OUTPUT
G2 422 FILE_CONTROL
G2 418 WORKING_STORAGE
G2 409 COPY
G2 342 SUBTRACT
G2 296 WHEN
G2 296 REWRITE
G2 269 ACCEPT
G2 219 DIVIDE
G2 218 NEXT
G2 186 ZCSTART
G2 154 NOT
G2 152 MULTIPLY
G2 150 RETURN
G2 147 SEARCH
G2 134 USE
G2 125 CALL
G2 111 INSPECT
G2 103 DISPLAY
G2 96 ALTER
G2 95 EVALUATE
G2 94 CONTINUE
G2 90 END_DECLARATIVES
G2 64 SEND
G2 47 END_IF
G2 42 SORT
G2 40 ZCSD
G2 37 RELEASE
G2 34 UNSTRING
G2 34 STRING
G2 31 DELETE
G2 30 I_O_CONTROL
G2 30 END_DIVIDE
G2 29 ENABLE
G2 28 SPECIAL_NAMES
G2 22 LINKAGE
G2 22 @ERROR@
G2 21 END_READ
G2 20 ALPHABET
G2 19 DISABLE
G2 19 CD
G2 18 END_SUBTRACT
G2 18 END_ADD
G2 14 GENERATE
G2 14 CLASS
G2 13 RECEIVE
G2 12 END_MULTIPLY
G2 11 INITIALIZE
G2 11 COMMUNICATION
G2 11 CANCEL
G2 9 END_EVALUATE
G2 7 END_PERFORM
G2 6 TERMINATE
G2 6 SYMBOLIC
G2 6 REPORT
G2 6 RD
G2 6 MERGE
G2 6 INITIATE
G2 3 DATE_COMPILED
G2 2 SOURCE_COMPUTER
G2 2 OBJECT_COMPUTER
G2 2 DECIMAL_POINT
G2 2 CURRENCY
G2 1 SECURITY
G2 1 SD
G2 1 ORDER
G2 1 INSTALLATION
G2 1 DATE_WRITTEN
G2 1 AUTHOR
G2 1 @_BLANK
G2-OPCODE------------------------- --FREQ
G1 @_BLANK 1
G1 @_COMMENT 339044
G1 @ERROR@ 22
G1 ACCEPT 269
G1 ADD 7932
G1 ALPHABET 20
G1 ALTER 96
G1 AUTHOR 1
G1 CALL 125
G1 CANCEL 11
G1 CD 19
G1 CLASS 14
G1 CLOSE 1198
G1 COMMUNICATION 11
G1 COMPUTE 661
G1 CONFIGURATION 451
G1 CONTINUE 94
G1 COPY 409
G1 CURRENCY 2
G1 DATA 932
G1 DATE_COMPILED 3
G1 DATE_WRITTEN 1
G1 DECIMAL_POINT 2
G1 DELETE 31
G1 DISABLE 19
G1 DISPLAY 103
G1 DIVIDE 219
G1 ELSE 5752
G1 ENABLE 29
G1 END 474
G1 END_ADD 18
G1 END_DECLARATIVES 90
G1 END_DIVIDE 30
G1 END_EVALUATE 9
G1 END_IF 47
G1 END_MULTIPLY 12
G1 END_PERFORM 7
G1 END_READ 21
G1 END_SUBTRACT 18
G1 ENVIRONMENT 462
G1 EVALUATE 95
G1 EXIT 2053
G1 FD 842
G1 FILE 427
G1 FILE_CONTROL 422
G1 GENERATE 14
G1 GO 20826
G1 I_O_CONTROL 30
G1 IDENTIFICATION 466
G1 IF 14095
G1 INITIALIZE 11
G1 INITIATE 6
G1 INPUT_OUTPUT 422
G1 INSPECT 111
G1 INSTALLATION 1
G1 LABEL 43839
G1 LINKAGE 22
G1 MERGE 6
G1 MOVE 78200
G1 MULTIPLY 152
G1 NEXT 218
G1 NOT 154
G1 OBJECT_COMPUTER 2
G1 OPEN 1196
G1 ORDER 1
G1 PERFORM 46035
G1 PERIOD 129509
G1 PROCEDURE 917
G1 PROGRAM_ID 451
G1 RD 6
G1 READ 997
G1 RECEIVE 13
G1 RELEASE 37
G1 REPORT 6
G1 RETURN 150
G1 REWRITE 296
G1 SD 1
G1 SEARCH 147
G1 SECURITY 1
G1 SELECT 883
G1 SEND 64
G1 SET 932
G1 SORT 42
G1 SOURCE_COMPUTER 2
G1 SPECIAL_NAMES 28
G1 STOP 487
G1 STRING 34
G1 SUBTRACT 342
G1 SYMBOLIC 6
G1 TERMINATE 6
G1 UNSTRING 34
G1 USE 134
G1 WHEN 296
G1 WORKING_STORAGE 418
G1 WRITE 1717
G1 WS 70231
G1 ZCOBOL 451
G1 ZCSD 40
G1 ZCSTART 186

Notes:

  1. @COMMENT@ counts comment lines.  Note unless NOCOMMENT option is specified every COBOL line is also included as assembler comment.
  2. @BLANK@ counts blank lines
  3. @ERROR@ counts any lines without valid assembler opcode
  4. LABEL counts macro to generate unique procedure labels.
  5. PERIOD counts macro to end sentence.
  6. WS counts macro to define working-storage and linkage section
  7. ZCSD counts SD sort definition sections (SD is an assembler instuction)
  8. ZCSTART counts START macro (START is an assembler control instruction)

Generated HLASM Assembler Instructions

The following report showing all the generated HLASM opcodes for all 409 of the NIST COBOL programs assembled using option BAL was generated using the following command:

zpar\ZPARMLC \work\NIST\src\*.BAL

G3-ZPARMLC TOTAL OPCODES = 142
G3-ZPARMLC TOTAL LINES = 1588292
G3-ZPARMLC CURRENT DATE=08/22/09 TIME=06.16
G3-FREQ--- OPCODE
G2 433584 @_COMMENT
G2 199445 DS
G2 158158 LARL
G2 126601 EQU
G2 106991 L
G2 92823 MVC
G2 92819 BASR
G2 70291 DC
G2 24827 MVI
G2 24727 LAY
G2 22338 USING
G2 22170 ORG
G2 20563 DROP
G2 19095 BRC
G2 18763 PACK
G2 11704 MNOTE
G2 11028 CLC
G2 9423 LA
G2 9151 UNPK
G2 8656 ST
G2 8143 OI
G2 7681 AP
G2 7067 ZAP
G2 6951 ED
G2 6490 SVC
G2 6412 JNM
G2 6296 MVHI
G2 5911 AFI
G2 5809 CFI
G2 5290 LR
G2 2220 LOCTR
G2 2150 LH
G2 1583 IILF
G2 1558 CLI
G2 1387 DSECT
G2 1367 PRINT
G2 1353 BRAS
G2 1333 CSECT
G2 1322 LTR
G2 1241 SR
G2 1162 CP
G2 1120 STH
G2 1001 BR
G2 973 LHI
G2 934 MSFI
G2 900 LTORG
G2 884 LGFI
G2 871 BRZ
G2 841 CVB
G2 787 BCTR
G2 735 CVD
G2 701 STM
G2 687 LG
G2 603 STG
G2 565 JNE
G2 551 SP
G2 527 LRL
G2 525 ASI
G2 521 PFPO
G2 469 LMG
G2 459 END
G2 451 PUSH
G2 451 POP
G2 451 JZ
G2 451 CNOP
G2 451 BNE
G2 442 CXSTR
G2 409 COPY
G2 304 A
G2 291 AR
G2 274 SGR
G2 262 MVHHI
G2 259 AHI
G2 247 LGR
G2 236 CVBG
G2 195 EDMK
G2 182 STMG
G2 180 DP
G2 166 AG
G2 165 CHI
G2 149 CVDG
G2 141 MVGHI
G2 117 SGFR
G2 116 D
G2 114 SRP
G2 114 LT
G2 110 SRL
G2 95 CG
G2 75 AGF
G2 69 MVCL
G2 67 CGR
G2 61 LGF
G2 52 AGFR
G2 44 JM
G2 33 S
G2 27 MP
G2 26 IILL
G2 26 IILH
G2 25 SLL
G2 25 JL
G2 25 JH
G2 25 B
G2 24 CLCL
G2 23 LGH
G2 22 @ERROR@
G2 21 SRAG
G2 21 DXTR
G2 16 MVZ
G2 14 ALG
G2 14 ALCG
G2 13 LTG
G2 13 AH
G2 11 MEXIT
G2 11 MEND
G2 11 MACRO
G2 11 CD
G2 10 LPR
G2 10 LD
G2 10 JNO
G2 10 AGFI
G2 9 DR
G2 8 CH
G2 8 C
G2 7 SLGR
G2 7 SLBGR
G2 6 MSG
G2 5 DSGR
G2 4 TM
G2 4 STD
G2 4 SH
G2 4 SG
G2 4 MS
G2 4 LDR
G2 4 CLGR
G2 2 MSR
G2 1 SD
G2 1 MXTR
G2 1 LPGR
G2 1 JO
G2 1 JNL
G2 1 AGSI
G2 1 @_BLANK
G2-OPCODE------------------------- --FREQ
G1 @_BLANK 1
G1 @_COMMENT 433584
G1 @ERROR@ 22
G1 A 304
G1 AFI 5911
G1 AG 166
G1 AGF 75
G1 AGFI 10
G1 AGFR 52
G1 AGSI 1
G1 AH 13
G1 AHI 259
G1 ALCG 14
G1 ALG 14
G1 AP 7681
G1 AR 291
G1 ASI 525
G1 B 25
G1 BASR 92819
G1 BCTR 787
G1 BNE 451
G1 BR 1001
G1 BRAS 1353
G1 BRC 19095
G1 BRZ 871
G1 C 8
G1 CD 11
G1 CFI 5809
G1 CG 95
G1 CGR 67
G1 CH 8
G1 CHI 165
G1 CLC 11028
G1 CLCL 24
G1 CLGR 4
G1 CLI 1558
G1 CNOP 451
G1 COPY 409
G1 CP 1162
G1 CSECT 1333
G1 CVB 841
G1 CVBG 236
G1 CVD 735
G1 CVDG 149
G1 CXSTR 442
G1 D 116
G1 DC 70291
G1 DP 180
G1 DR 9
G1 DROP 20563
G1 DS 199445
G1 DSECT 1387
G1 DSGR 5
G1 DXTR 21
G1 ED 6951
G1 EDMK 195
G1 END 459
G1 EQU 126601
G1 IILF 1583
G1 IILH 26
G1 IILL 26
G1 JH 25
G1 JL 25
G1 JM 44
G1 JNE 565
G1 JNL 1
G1 JNM 6412
G1 JNO 10
G1 JO 1
G1 JZ 451
G1 L 106991
G1 LA 9423
G1 LARL 158158
G1 LAY 24727
G1 LD 10
G1 LDR 4
G1 LG 687
G1 LGF 61
G1 LGFI 884
G1 LGH 23
G1 LGR 247
G1 LH 2150
G1 LHI 973
G1 LMG 469
G1 LOCTR 2220
G1 LPGR 1
G1 LPR 10
G1 LR 5290
G1 LRL 527
G1 LT 114
G1 LTG 13
G1 LTORG 900
G1 LTR 1322
G1 MACRO 11
G1 MEND 11
G1 MEXIT 11
G1 MNOTE 11704
G1 MP 27
G1 MS 4
G1 MSFI 934
G1 MSG 6
G1 MSR 2
G1 MVC 92823
G1 MVCL 69
G1 MVGHI 141
G1 MVHHI 262
G1 MVHI 6296
G1 MVI 24827
G1 MVZ 16
G1 MXTR 1
G1 OI 8143
G1 ORG 22170
G1 PACK 18763
G1 PFPO 521
G1 POP 451
G1 PRINT 1367
G1 PUSH 451
G1 S 33
G1 SD 1
G1 SG 4
G1 SGFR 117
G1 SGR 274
G1 SH 4
G1 SLBGR 7
G1 SLGR 7
G1 SLL 25
G1 SP 551
G1 SR 1241
G1 SRAG 21
G1 SRL 110
G1 SRP 114
G1 ST 8656
G1 STD 4
G1 STG 603
G1 STH 1120
G1 STM 701
G1 STMG 182
G1 SVC 6490
G1 TM 4
G1 UNPK 9151
G1 USING 22338
G1 ZAP 7067

Notes:

  1. @COMMENT@ count comments
  2. @MAC_COMMENT@  count macro comments
  3. @BLANK@ count blank lines
  4. @ERROR@ count any lines without valid assembler opcode
     

Pending Priority List for zcobol Development

The following priorities for the open source zcobol portable COBOL compiler are based on user feedback.  Special thanks to Bill Klein for starting the process.  To submit your priorities, join the zcobol user email group and post your requests:

  • Nucleus
    • Data Division (fix a few remaining unsupported clauses such as JUSTIFIED RIGHT)
    • IF (add support for expressions using ZC_CALC shared with COMPUTE)
    • MOVE CORRESPONDING
    • Functions
      • Date functions
      • Ordering  (MIN, MAX, ORD-MIN, and ORD-MAX)
      • MIsc ORD, CHAR, UPPER-/LOWER-CASE
      • Math functions (SQRT, SIN, COS, etc.).
  • Debugging
    • EXHIBIT (READY/RESET TRACE already done)
  • File Access
    • Sequential (ESDS, QSAM,LINE SEQUENTIAL already done)
    • Random (RRDS, BDAM)
    • Indexed (KSDS)
  • Source text management
    • REPLACE (COPY REPLACING already supported)
  • SORT and MERGE
  • Last priority after everything else is done
    • Segmentation
    • Communications
 

IBM, CICS, HLASM, MVS, OS/390, VSAM, z9, z10, and z/OS
 are registered trademarks  of International Business Machines Corporation

This page last updated Monday September 14, 2009.   Webmaster
Copyright 2009 Automated Software Tools Corporation


This site is a member of WebRing.
To browse visit Here.