gnucobol

Adding two integers giving unwanted result in cobol

北城以北 提交于 2021-02-19 07:40:28
问题 I'm reading a file into a table, note the first line is not part of the table. 1000 MS 1 - Join Grps Group Project 5 5 Four Programs Programming 15 9 Quiz 1 Quizzes 10 7 FORTRAN Programming 25 18 Quiz 2 Quizzes 10 9 HW 1 - Looplang Homework 20 15 In the code, the table is represented as follows: 01 GRADES. 05 GRADE OCCURS 1 TO 100 TIMES DEPENDING ON RECORD-COUNT INDEXED BY J. 10 ASSIGNMENT-NAME PIC X(20). 10 CATEGORY PIC X(20). 10 POINTS-POSSIBLE PIC 9(14). 10 POINTS-EARNED PIC 9(14). I have

Cobol-Restart from the program

女生的网名这么多〃 提交于 2021-01-28 23:22:18
问题 I have a little question I wrote a calculator in cobol, and I'm not so expert I give you here the code: DISPLAY "CALCOLATRICE". DISPLAY "ATTENZIONE, IL RISULTATO NON HA SEGNI!". DISPLAY "CHE VUOI FARE?". DISPLAY "1 ADDIZIONE". DISPLAY "2 SOTTRAZIONE". DISPLAY "3 MOLTIPLICAZIONE". DISPLAY "4 DIVISIONE". DISPLAY "5 ESCI" ACCEPT INPUT1 IF INPUT1 = 5 DISPLAY "OK, BUON LAVORO :)" STOP RUN END-IF. IF INPUT1 = 1 DISPLAY "PRIMO NUMERO" ACCEPT A DISPLAY "SECONDO NUMERO" ACCEPT B COMPUTE C= A + B

Executable program requested but PROCEDURE/ENTRY has USING clause

杀马特。学长 韩版系。学妹 提交于 2019-12-24 02:39:16
问题 Does anyone one know what is causing this compilation error? I'm trying to compile a legacy COBOL program using OpenCOBOL. This is the error that I'm getting : Error: Executable program requested but PROCEDURE/ENTRY has USING clause This is how my procedure division looks: procedure division using array-area, m, err, sum1. And this is the linkage section from my working station: working-storage section. 77 i picture s99 usage is computational. 77 prev picture s9(8) usage is computational. 77

Ubuntu GnuCobol CURRENCY SIGN IS “£” causes compile errors

被刻印的时光 ゝ 提交于 2019-12-10 14:16:30
问题 Using GnuCOBOL 2.2.0 on Ubuntu 18.10. Working through 'Beginning COBOL for Programmers' by Michael Coughlan. GnuCOBOL has been compiling the book's examples without trouble up until Chapter 9, when this program: IDENTIFICATION DIVISION. PROGRAM-ID. Listing9-2. AUTHOR. Michael Coughlan. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. CURRENCY SIGN IS "£". DATA DIVISION. WORKING-STORAGE SECTION. 01 Edit1 PIC £££,££9.99. PROCEDURE DIVISION. Begin. MOVE 12345.95 TO Edit1 DISPLAY

COBOL - Differing answer from mainframe to PC for same COMPUTE

a 夏天 提交于 2019-12-08 15:51:56
问题 I have this very simple dummy COBOL program which does a dummy COMPUTE and displays the result. ID DIVISION. PROGRAM-ID. DUMMYPGM. DATA DIVISION. WORKING-STORAGE SECTION. 01 NUM-A PIC 9(3) VALUE 399. 01 NUM-B PIC 9(3) VALUE 211. 01 NUM-C PIC 9(3). * PROCEDURE DIVISION. MAIN. COMPUTE NUM-C = ((NUM-A / 100) - (NUM-B / 100)) * 100 DISPLAY 'NUM-C IS ' NUM-C STOP RUN. When I compile this code on a mainframe (with compiler MVS Enterprise COBOL V4.2) and execute it, I get "NUM-C IS 100", probably