Questions tagged [cobol]

COBOL (COmmon Business Oriented Language) was the product of a US Department of Defense initiative to develop a standard and portable programming language for business applications. COBOL celebrated its 50th birthday in 2009. It is generally believed that new COBOL development is in decline but new ISO/IEC COBOL standards still evolve and a commercial commitment remains to keep the language relevant in today’s computing landscape.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Practical use of in-code encryption/hashing in COBOL/DB2 without RACF?

I am curious about the legitimate use cases of handling encryption or hashing directly within the COBOL/DB2 code without relying on External Security Managers (ESM). As many may know, a significant ...
mllamazares's user avatar
  • 7,906
0 votes
1 answer
31 views

table overflow when using PERFORM VARYING

I'm doing a simple PERFORM VARYING WS-IND FROM 1 BY 1 Bellow is my code: PERFORM VARYING WS-INDICE FROM 1 BY 1 UNTIL WS-INDICE > 9 OR TEST-OBJEC(WS-INDICE) = SPACES ...
Ahmed SEDDIK's user avatar
0 votes
1 answer
51 views

Reversing string with COBOL

I am trying to reverse given string in COBOL. IBM documentation I refered to IBM documentation here: https://www.ibm.com/docs/en/cobol-zos/6.1?topic=functions-transforming-reverse-order-reverse This ...
Stefan Glova's user avatar
2 votes
1 answer
62 views

ZOS/Unix cob2 compiling and executing

I'm starting with Cobol on ZOS/Unix. My  environment is terminal via SSH to ZOS machine. I have Cobol program hello.cbl with basic code to display message.        IDENTIFICATION DIVISION.        ...
mysiar's user avatar
  • 462
1 vote
0 answers
50 views

Cobol program does not want to read assigned file

I am currently in a Cobol course and I have an assignment that requires the program to fetch data from two assigned files. However I am receiving an error in my compiler that goes by libcob: error: ...
justinlesn's user avatar
0 votes
1 answer
52 views

X type variable (REDEFINGED AS digit, with 'SIGN IS TRAILING SEPARATE') changed after execute "IF xxx NUMERIC"

I'm working on opencoobol1.1, and I encountered the weird problem: Here is the Cobol code: 03 WS-INP PIC X(30). 03 WS-INP-D REDEFINES WS-INP. ...
llx's user avatar
  • 1
0 votes
2 answers
63 views

Even or Odd number in COBOL language

I am trying to write a function in COBOL language which check if number is even or odd and return accordingly. But instead, it shows error. This is my code: IDENTIFICATION DIVISION. ...
Stefan Glova's user avatar
0 votes
1 answer
40 views

How to delete variable leading zeros in Cobol program?

In the Cobol language: I use a numeric variable that is initially defined as the size. If the user typed a number smaller than the size I declared, there are unnecessary zeros at the beginning. How do ...
tzipi2003's user avatar
1 vote
2 answers
65 views

GnuCobol calling C function with argument of type double

I have C two functions doing exactly the same thing. The only difference is their return type and first argument type: int func1(int a, int *b) { if (a > 0) { *b = 0; return 1; ...
mysiar's user avatar
  • 462
0 votes
0 answers
43 views

jrecord to convert cobol data files to csv with S3 file system

We have been using JRecord library to read Cobol data files and convert them to csv files by passing copybooks as input arguments. That works fine with command like below java -jar Cobol2Csv.jar -C ...
Rajashekhar Meesala's user avatar
0 votes
1 answer
108 views

Suppressing array data element in COBOL JSON GENERATE

I am trying to generate a JSON from the below Cobol structure using COBOL GENERATE statement of COBOL 6.3. I would like suppress the data elements in array based on their values. For example, would ...
Jijo's user avatar
  • 43
0 votes
2 answers
46 views

Using JRccord to access COBOL schema

I'm trying to use JRecord version 0.93 to parse a COBOL copybook to understand the individual fields present in the record. I'm a complete newbie to JRecord and I'm struggling to get what seems like a ...
Valerie R's user avatar
  • 1,769
0 votes
0 answers
62 views

CPU consumption increased on db2 batch

I'm trying to optimize CPU consomption. I have a DB2 batch that invoke physical accessor that contains database query. When i run this batch: i have a CPU consumption of 30%. I want now to eleminate ...
Ahmed SEDDIK's user avatar
0 votes
1 answer
40 views

Create / drop table in postgres using InstantSql in rmcobol

Using the document below, I was able to perform select/update/insert using rm/cobol to Postgres Database in Linux. https://www.microfocus.com/documentation/rm-cobol/1214/ISQLhelp/...
user22426344's user avatar
0 votes
1 answer
72 views

Problem encountered with Merging 3 files together with ICETOOL and placing them in seperate columns in an OUTPUT file

Recently encountered a problem with a merge/fusion using JCL code that i was trying to do today. To explain, I wanted to use ICETOOL to fusion/merge 3 different files and place the datas from these ...
Prince.T's user avatar
0 votes
2 answers
68 views

READ or READ INTO

In quite a few COBOL tutorials about file reading, I see that they use the READ fd INTO variable statement instead of the READ fd one. They have to code a duplicate structure format: one for the file ...
Itsbananas's user avatar
0 votes
0 answers
48 views

using an Excel file for online transaction in cobol mainfram

I want to know, is there any way to import an Excel file into a db2 table during an online transaction ? I do not want to use batch program for this issue
elham sh's user avatar
1 vote
0 answers
47 views

How to print nested Control Headings using Report Writer and GnuCOBOL?

I'm trying to create a report declared in the "report section" of a COBOL program. The program takes the data.txt file as input, and writes the report to the report.txt file. Here you can ...
Zug's user avatar
  • 113
1 vote
1 answer
146 views

Calling REST API HTTPS endpoint in JSON format from Cobol 6.3

I am trying to perform below EXEC CICS WEB CONVERSE command and communicate with https endpoint in JSON format from Cobol while performing which I am getting socket error. Response code as 17 and 42 ...
G Dilip Yadav's user avatar
2 votes
2 answers
100 views

call external C library from COBOL

I'm extperimenting COBOL last times and I having trouble with link and external call with COBOL First, i have a simple test lib source code: // testlib.c #include <stdio.h> void CFUNC() { ...
Prince 2 lu's user avatar
0 votes
1 answer
95 views

Reading/parsing a copybook in text format using JRecord, the builder seems to think it's an XML file

I'm trying to read,parse a copybook in .txt format using JRecord and then process a binary file using the copybook schema. When I try to read the binary file using schemaBuilder.newReader(binaryFile), ...
Mathamagic's user avatar
0 votes
2 answers
67 views

Convert a decimal number in Java into its assumed decimal Cobol representation

I have a requirement to convert a regular number (most likely with 2 decimal digits) into its respective Cobol counterpart with so called assumed decimal point in the following format: 9(9)v99. I ...
Simeon Leyzerzon's user avatar
0 votes
2 answers
120 views

how to configure vs code for cobol

thanks in advance for ur help. Im learning cobol, but i have so many problems with the formatting and error hilighting, im using BroadcomMFD.cobol-language-support extension, but always says that my ...
Hen's user avatar
  • 1
2 votes
2 answers
53 views

How to write data into multiple files using Powershell

I have a folder having Cobol source code, and I am trying to extract comments from the file. Below code is working for me and extracting comments into a single file. $files = Get-Childitem -Path 'C:\...
Jyotsna_Bulchandani's user avatar
0 votes
0 answers
79 views

How to run a Cobol application on Hercules mainframe emulator (Terminal 3270)

I am beginner to mainframe applications and want to perform a simple POC for understanding where I want to run a sample Cobol application on Hercules mainframe emulator with terminal 3270, application ...
Shivam Shukla's user avatar
0 votes
1 answer
98 views

PowerShell: Code to extract data length and precision from Cobol Copybooks

=== Problem Statement === Code to extract data length in digits (not in bytes) and precision from Cobol Copybooks considering all the different data types for PIC format Will this code be sufficient ...
your.godlike.gamer's user avatar
0 votes
1 answer
61 views

running cobol in visual studio code problem with json file

I'm trying to compile cobol code in vs studio code, but got problem with the json file, see: https://dickens.co.in/run-cobol-vscode-msys2-windows below is the json file: The problem is the row with - &...
jorgen g's user avatar
1 vote
0 answers
70 views

HTTP API call from Cobol DB2 program

As per the assignment I need to develop a Cobol DB2 program that calls HTTP requests to get the data from web application. Any help on how to make http calls from cobol program (Open source)? My ...
SRI's user avatar
  • 131
0 votes
2 answers
94 views

git diff - git difftool - vimdiff - How to compare two files from column 1 to 72 - It's possible config one of this tools

For mainframe modernization I'm using git to modify my Cobol programs. To compare two programs one in Dev stage and another in Prod stage, I would like to compare them only from column 1 to 72. I ...
RedGoldPhoenix's user avatar
1 vote
1 answer
47 views

Selected Node Not Available RC=40

I am new to Mainframe/COBOL and have a question about an error I am receiving when attempting to run my program in XPediter. I get a message after attempting to run my program SELECTED NODE NOT ...
jason jenkins's user avatar
0 votes
1 answer
113 views

COBOL program syntax errors - unexpected identifiers

I am trying to get this COBOL program running for a school assignment, but am having issues compiling that I can't find the cause for. The code is: ENVIRONMENT DIVISION. INPUT-OUTPUT ...
J Phil's user avatar
  • 1
0 votes
2 answers
99 views

Remove Duplicate string(s) from data set

I have a input file like below : A->B->C->E A->B->C->D B->C->D C->D D->E ........ ........ My requirement is to write only unique string in output file. If any ...
Azhar's user avatar
  • 1
4 votes
1 answer
150 views

How do I setup a git project for COBOL on z/OS?

I have a git project that contains mostly z/OS COBOL source code. When I clone it onto my z/OS system using: git clone myproject I noticed that all of the cloned files are in ASCII (ISO8859-1). Is ...
Igor Todorovski's user avatar
0 votes
0 answers
70 views

run db2 program usin spool write in cicsweb

I am trying to execute db2 program(prg01) using spool open, spool write and spool close commands. DB2 program thet I want to execute, just insert a record into table t01. in other cicsweb program(...
Ebi's user avatar
  • 1
0 votes
1 answer
68 views

Read all records from the database using call functions in ims

I want to write a batch program with IMS that can get all the records in the database. The structure of my database is as follows: a root segment and a segment below it that has several occurrences ...
Monir Khosravi's user avatar
3 votes
1 answer
97 views

CALL unpredicatably changes unrelated variables in program

To preface, I am incredibly new to COBOL, and have only been writing it for about a week. I wrote a program that plays a Rock-Paper-Scissors (RPS) game and the computer randomly picks an option each ...
Ethan Krug's user avatar
1 vote
1 answer
78 views

Need hlp with cobol\db2 homework

I have this program where I need to read the table DB2.SMLC_RGR_PRCT_RCS where the field NR_SMLC_RGR_PRCT = I01-NR-SMLC-RGR-PRC, comparing the value of the variable with the field and only advancing ...
Laerte Silva's user avatar
1 vote
1 answer
97 views

Suppress the root element in COBOL JSON GENERATE

I'm using the JSON GENERATE statement with IBM Cobol like this (shortened) example: JSON GENERATE WS-JSON FROM CBL-GROUP COUNT IN WS-JSON-LEN ...
Alexander Meins's user avatar
2 votes
1 answer
119 views

IBM Z Zowe Mainframe issue

I am doing the learning Cobol programming with VScode Ive tried restarting VS and re entering the steps. In LAB 2 after step 12 there are more inputs that are not in the guide and if you do not fill ...
OMG It's Jason Born To Code's user avatar
1 vote
0 answers
68 views

Why is the Character output in out parameter getting substringed to some limit in DB2

I have created a stored procedure to call with some input parameters and get out related to that. The maximum limit of characters I have given 5000. But on calling the procedure the Output parameter ...
Aditya Kumar's user avatar
-1 votes
2 answers
60 views

gnucobol "unexpected Identifier, expecting DIVISION"

I write simple program: 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. dnd. 000300 AUTHOR. Ishayahu Lastov. 000400 DATE-WRITTEN. 15/05/2023 000500 ENVIRONMENT DIVISON. 000600 DATA DIVISION. 000700 ...
Ishayahu's user avatar
  • 349
1 vote
2 answers
134 views

Fill file field PIC 9(11) COMP-3 with data manually

I want to fill my Input file with data manually. What i'm supposed to put in a field with type PIC 9(11) COMP-3. Can anyone help me ?
Ahmed SEDDIK's user avatar
1 vote
1 answer
67 views

S0C7 while moving PIC 9(11) COMP-3 to PIC 9(11)

I'm moving a field which is in PIC 9(11) COMP-3 coming from an INPUT file to PIC 9(11). I'm getting S0C7 error or ABEND Bellow is my code: 10 FIELD-FROM PICTURE 9(11) OCCURS 012 ...
Ahmed SEDDIK's user avatar
1 vote
1 answer
171 views

how to get data from queue in cobol?

I want to get data from queue in a cobol program in a way that the program listens to queue and wait for message,if queue is empty the program waits, once a message is coming to queue, it gets the ...
Soraya's user avatar
  • 29
1 vote
2 answers
104 views

Cobol z/OS: how to determine calling parameters in debug mode?

for z/OS Cobol the linkage-section defines data structures that can be shared with other programs. What I wanted to ask: when I am debugging a cobol program with the z/OS debugger is there a way to ...
user11654732's user avatar
0 votes
1 answer
198 views

How to diagnose an abend in CICS using offset number

I am seeing AD2R abend while online job monitoring. Please guide me how to check reason of this abend in the below attached image. Message : The system or user abend AD2R was issue. From compile unit ...
Rekha's user avatar
  • 21
1 vote
4 answers
155 views

COBOL, populating a table

New to COBOL.. I would like to populate a table. I want it to have two columns and eight rows in each column. I want to "hard code" these different values into the first colum, with one in ...
eeeeee111111's user avatar
1 vote
1 answer
79 views

Is cobol declarative language or its is imperative

while COBOL does support some declarative programming constructs, it is primarily an imperative programming language that is designed to provide low-level control over the machine, and its main focus ...
Shahnaz Memon's user avatar
1 vote
1 answer
158 views

Db2 SQL - how to switch among different where conditions

Need your advice on the below scenario. An old COBOL program has SELECT SQL where it has multiple WHERE clauses. But these WHERE clauses don't act together. Depending on variable values a single WHERE ...
Subrata's user avatar
  • 11
3 votes
1 answer
107 views

How to execute a variable length UNPK instruction (IBM mainframe ASM) in COBOL?

I have a legacy code written in ASM that is required to convert to COBOL. The ASM code is as follows, EX R8,UNPK1 OI UNWK16+15,X'F0' UNPK1 UNPK UNWK16(16),0(0,R4) UNWK16 ...
Chou Tan's user avatar

1
2 3 4 5
35