Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
69 views

syntax error messages "not terminated" and "unexpected END-IF"

I'm having a constant issue with the UPDATE-PRODUCT portion. I'm getting an error at Line 103: PERFORM statement not terminated by END-PERFORM and at Line 117: syntax error, unexpected END-IF. ...
Gabriel Tran's user avatar
1 vote
2 answers
76 views

Recursive Pascal Triangle Entry Calculator

I was trying to do a Pascal's triangle entry calculator in COBOL. I wanted to try to use a recursive function. I am a beginner so I looked online for how one may implement this kind of function in ...
Francesco Raso Stoia's user avatar
0 votes
0 answers
25 views

Format faliure merging word template with *.csv file data

I get a format faliure pop up, when trying to merge a *.csv file datasource with a word template in a Cobol program. The faliure arises in following line of code: MODIFY someHandleNumber ...
Roar Pedersen's user avatar
0 votes
2 answers
60 views

GnuCobol file not found

I am looking for a solution for the following problem. I run a very simple cobol program to read a file. I use the following code : IDENTIFICATION DIVISION. PROGRAM-ID. GADGETS. ...
Jamal Ait Lhassan's user avatar
0 votes
1 answer
40 views

How to correctly place the space at 0101 position

Im using cobol 85 to create a program which inputs number of 10 digits, and if user types "END" the program ends. But i cant seem to clear the screen using DISPLAY AT "position". ...
Gerelmaa Sergelen's user avatar
1 vote
1 answer
47 views

Moving LENGTH OF to a COMP field fails parse

I receive a PARSE ERROR on the MOVE statement below indicated by the comment. I have tried a variety of changes, but I cannot discern what is wrong. I am new to COBOL. Sorry for the horrible ...
Andy's user avatar
  • 99
0 votes
3 answers
71 views

INITIALIZE PACKED-DECIMAL field on DB2 Query

I'm using a PACKED-DECIMAL field COMP-3 on the WHERE clause on a DB2 QUERY. When i initialize the zone and i want to display it: It shows: 0404040404 ==> It means that the field contains LOW-VALUE ...
Ahmed SEDDIK's user avatar
0 votes
0 answers
68 views

COBOL program has a faulty check

I have the following COBOL program: At the end, I ask the user if the results are "Good Enough." However, no matter what I type, it always says: "Cool, glad you like it!" Even when ...
SkyeBoniwell's user avatar
  • 7,000
0 votes
2 answers
107 views

ROUNDED statement in COBOL

I need to write a code to round the 4 decimal data to 2 decimal data. VAR-A PIC S9(15)V9(4) VALUE 1111.1294 VAR-B PIC S9(15)V99 VALUE ZERO. when i MOVE VAR-A to VAR-B the expected value is 1111.13 ...
Prakash's user avatar
0 votes
3 answers
157 views

gnucobol failing to open/create an indexed file

Following a course in COBOL, I'm trying to create an indexed file. Many times the file reading chapter precedes the writing one, so I had no file to read, and an indexed file is not just a file. ...
alex's user avatar
  • 887
0 votes
1 answer
190 views

SORT to merge two files and append data without changing lrecl

I have two files with the same layout and LRECL FIELD NAME FIELD LENGTH STORE-CUSTOM-ID X(08) STORE-GROUP X(25) STORE-LIST 9(04) OCCURS 500 TIMES I want to Merge these ...
Aarthi M's user avatar
0 votes
0 answers
47 views

HP NonStop NOWAIT I-O

Is it possible to write a NOWAIT I-O in HP NonStop COBOL? I have a task to write a program to generate three "reports" [CSV files to be downloaded to a desktop for use in EXCEL]. I think I ...
user62742's user avatar
1 vote
2 answers
115 views

Error compiling COBOL program with sequential files

I have this COBOL program in my mainframe: IDENTIFICATION DIVISION. PROGRAM-ID. TEST2. ...
Juan's user avatar
  • 23
0 votes
2 answers
118 views

Invalid memory address error in my COBOL application

I wrote this COBOL application to perform a prime factorization, it is not yet completed. When I run the code, I get this error/output: Programm zur Darstellung der Primfaktorzerlegung mit einer ...
Luka's user avatar
  • 25
1 vote
2 answers
98 views

Segmentation fault error in my COBOL application

I wrote this COBOL application to perform a prime factorization, it is not yet completed. When I run the code, I get this error: unknown (signal) cobc: aborting compile of jdoodle.cobc at line 68 (...
Luka's user avatar
  • 25
0 votes
1 answer
49 views

Multiple PROGRAM-ID's without matching END PROGRAM

I am trying to implement a simple calculator in COBOL and struggling with a particular issue. My compiler, GNU Cobol 3.2.0 is always giving me this issue and I do not know how to fix ist. The error is:...
Luka's user avatar
  • 25
0 votes
1 answer
109 views

Need help for the IBM COBOL Program Status Clause

I need a function or procedure to retrieve a username, libraryname, modulename, etc. from the active running program. The IBM documentation tells me something about "program status structur"!...
user25168478's user avatar
1 vote
0 answers
77 views

How to separate line of text by commas in COBOL

Hello Im learning COBOL and have a text file that has a bunch of works and numbers separated by ",". I need it to stop when it hits the comma and then move to the next variable and so on. ...
Theo 17's user avatar
  • 27
1 vote
1 answer
156 views

Resolving MinGW Error with GnuCOBOL on Windows

I am not certain whether this is a MinGW issue, or if there's some problem with the way that GnuCOBOL's cobc is calling the C compiler. I've looked through the manual, but I'm not seeing anything ...
Chris-AF's user avatar
0 votes
2 answers
77 views

Reading dataset with HEX ON

I'm searching how to visualize and read data manually which is declared like this: 04 DATE PICTURE 9(9) COMPUTATIONAL-3. One of my colleagues said to me to put HEX ON When I put the command HEX ON,...
Ahmed SEDDIK's user avatar
0 votes
0 answers
60 views

A cursor locks a file but doesn't release it (AS/400 COBOL + DB2)

I have a program that uses a table both in a SQL cursor and as a file (READing and WRITE-ing it). Now, every time the program runs a OPEN CURSOR that uses the table, I see in WRKOBJLCK that another ...
Alda's user avatar
  • 27
0 votes
1 answer
154 views

Call GENUUID from COBOL AS400

GENUUID is the IBM provided procedure. I can find the example of calling GENUUID from RPG, but need to add _(Underscore) in the name EXTPRC('_GENUUID') but I don't know how to do this in COBOL. I ...
AS400 Developer's user avatar
0 votes
1 answer
61 views

Decimals are not stored in a numeric variable

I’m just starting with COBOL, and I’m testing storing and displaying values on the screen. When the user enters the value 10.5 in the terminal, the program stores it as 10.0. I’m using the GnuCOBOL ...
Euriloco's user avatar
  • 253
0 votes
0 answers
91 views

COBOL program calling LE C program

I am trying to call a LE C program (test program that just prints the arguments) from my COBOL program. I pass a structure to my C program and print the received values. However, as you can see in the ...
rahul bajaj's user avatar
0 votes
1 answer
62 views

Foreground color doesn't work in Gnucobol for Windows

I am using GnuCobol for Win 10. I need to display a console screen with black background and green foreground but doesn't work, It doesn't using the foreground color, neither the background color does....
reymagnus's user avatar
  • 371
0 votes
1 answer
71 views

How to pass Job Max RC / Last CC to COBOL Program

Imagine there is a PGM=SORT step in a job that ends with RC=8 after execution, I need to send that RC value (or last CC) through a parameter to a COBOL program in the next step. How can I use/send the ...
Mohamad Heydari's user avatar
0 votes
1 answer
31 views

Unwanted underscore using filler displaying from screen section

I am using GnuCobol for Win 10. When I use filler with spaces in a normal display the screen shows the spaces, but when I use filler in screen section I get unwanted underscores (_____). Is ther any ...
reymagnus's user avatar
  • 371
0 votes
1 answer
37 views

Is there a way to make the output file-name in cobol configurable (taking file-name as input from the user)?

IDENTIFICATION DIVISION. PROGRAM-ID. HelloProgram. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT OutputFile ASSIGN TO DYNAMIC-FILE-NAME ORGANIZATION IS ...
Manya Tiwari's user avatar
0 votes
1 answer
45 views

COBOL file creation of DAT file is not successful

I am getting this error below when the COBOL code is run. 'EmployeeFile' is not defined 'EmployeeFile' is not a file name Here is the COBOL code. IDENTIFICATION DIVISION. PROGRAM-ID. ...
Renato D. Mejilla's user avatar
0 votes
1 answer
112 views

CICS WEB RECEIVE data missing

I execute this code: E0198 EXEC CICS WEB RECEIVE SESSTOKEN(WS-SESSION-TOKEN) E0198 STATUSCODE(WS-HTTP-STATUS-CD) E0198 STATUSTEXT(WS-HTTP-STATUS-TEXT) E0198 ...
user3586521's user avatar
0 votes
2 answers
75 views

Keep trailing spaces when writing to file organization line sequential

I'm using GnuCOBOL and writing to a file, organization is line sequential, and I need to keep trailing spaces. Line sequential appends the [CR][LF] characters, but does so after removing trailing ...
SubwayDawg's user avatar
0 votes
1 answer
74 views

CIty-data cannot be subscripted -Error compiling cobol program

IDENTIFICATION DIVISION. PROGRAM-ID. Assignment00. DATA DIVISION. WORKING-STORAGE SECTION. 01 Temperature PIC 9(3)V9(1). 01 Counter PIC 9(2) VALUE 1. 01 City-Names. 05 City-...
Cindy Wilson's user avatar
0 votes
2 answers
123 views

Z/OS Cobol 6.3 copy: how to include only a chunk?

I need this information: I have a Cobol 6.3 program “PROGRAM1” that includes a copy statement COPY1. COPY1 contains only data definition, it can be included in WORKING STORAGE or LINKAGE SECTION. I ...
AlbertoG's user avatar
0 votes
1 answer
267 views

Trying to add gm and hm calculations to cobol program

i'm trying to update the program by adding the following features: • Two measures of central tendency - geometric mean (GM), and harmonic mean (HM) • One measure of dispersion - root mean square (RMS) ...
user23756814's user avatar
1 vote
1 answer
160 views

Cobol program wont read until end of file

COBOL program wont read until end of file. It should read line by line, 8 character number followed by 72 empty charctacters till it reads in next number. I've added the WORKING-STORAGE SECTION, DATA ...
user23756814's user avatar
1 vote
1 answer
134 views

Cobol errors, cannot seem to figure it out

I'm encountering compilation errors in my COBOL program, where the compiler is indicating that file names like 'INPUT-FILE' and 'OUTPUT-FILE' are not defined. Despite defining these files in the FILE ...
user23756814's user avatar
0 votes
1 answer
234 views

Cobol file WRITE not allowed, file not open for output (status = 48) for file output-file

I have the following Cobol program that I am attempting to refactor it to be functional. The program is supposed to read an input file and output some stats. I am getting one major error, and one ...
user avatar
0 votes
2 answers
209 views

Record grouping and aggregation

I have a fixed record file with several millions of records containing sales for several thousands customers. I need to generate file with one record for each customer containing customer id, sales ...
karbi79's user avatar
  • 109
0 votes
1 answer
394 views

open fetch and close cursor DB2

I'm using DB2 cursors. My table contains 4 rows. Bellow is the list of instructions that i have done on my code: 1- OPEN CURSOR 2- FETCH CURSOR 3- FETCH CURSOR 4- CLOSE CURSOR 5- OPEN CURSOR 6- FETCH ...
Ahmed SEDDIK's user avatar
0 votes
0 answers
44 views

How to create comments using only * in COBOL? [duplicate]

I've just started reading about COBOL. In many articles they say that comment can be created using only *, I mean without using *>. I tried to use it in column 1 and column 7 but I got syntax error ...
user avatar
-4 votes
1 answer
115 views

DB2 contention issues

We are experiencing serious performance degrades and sometimes outages due to DB2 contention issues. Covol DB2 batch program is having contentions with distributed threads from Stored procedures ...
user23568506's user avatar
1 vote
1 answer
159 views

Using the routine CSNBOWH on IBM I - MD5

I am trying to run the routine CSNBOWH on IBM I using COBOL ILE on the pubblic server PUB400. To do the call I used various definition taken from Internet/manuals. This is the last one I used: 01 ...
Daniele's user avatar
  • 13
1 vote
1 answer
126 views

Addition of PIC 9 variable with space not causing ABEND S0C7

I expected the ADD instruction in the following COBOL program to trigger an ABEND S0C7. However the program terminated normally and the ouput was quite surprising. The SYSIN in the JCL //SYSIN DD * ...
Itsbananas's user avatar
1 vote
2 answers
152 views

FIlling a zone with S9(5)V9(8) COMP-3

I want to fill a file with this type of data. 01 FILE-LINE. 05 VAR1 PIC S9(5)V9(8) COMP-3. 05 VAR2 PIC S9(15)V99 COMP-3. Can anyone help me to fill this lines When i put All '0' on ...
Ahmed SEDDIK's user avatar
0 votes
0 answers
72 views

Microfocus COBOL - Remote debugging requires ALL programs to be compiled for debugging?

Being new to Microfocus Cobol, I've setup a debug config to remotely debug programs that reside on an AIX server. The whole system consists of many programs. Only the programs that must be debugged ...
Peter L's user avatar
  • 51
0 votes
1 answer
106 views

VSCode snippet, how to force the starting column of a line?

as cobol dev, I have to start comments at a certain column in the code. I would like to know if there's a way to tell "for this line, start at column 7" to VSCode with snippets I didn't find ...
Evileoo's user avatar
1 vote
1 answer
121 views

Adding parenthesis in 'IF' statement

I have a question concerning the use of parenthesis in IF statements in COBOL. Let's say we have : 05 SHIRT-COLOR PIC X(02). 88 BLUE-SHIRT VALUE 'B '. 88 WHITE-SHIRT VALUE 'W '. I would ...
Lorine Monfils's user avatar
0 votes
2 answers
223 views

WEB CONVERSE to an api returns invalid request error (RC=400)

I am trying to make rest api call from my cics-cobol program. The Web-Open was successful. During the web converse i am getting return code = 400 with response - {"detail":"There was an ...
Mahalakshmi K's user avatar
1 vote
3 answers
141 views

How to process non formatted numeric variable from SYSIN DD from JCL in COBOL

I coded a very simple COBOL program that should take data from sysin dd * and put it in my WORKING-STORAGE variable, but it doesn’t work as expected. The problem is when I try to pass a value of 10 to ...
Tomaszcygan's user avatar
2 votes
1 answer
111 views

SEARCH ALL with a key PIC XX

I'm using SERACH ALL on a table with a key with a type PIC X(02) Bellow is my table declaration 01 WS-VAL PIC X(02). 01 WS-TABLE. 03 WS-TABLE-LINE OCCURS 400 TIMES ...
Ahmed SEDDIK's user avatar

1
2 3 4 5
36