1,800 questions
Advice
3
votes
6
replies
68
views
I need to column "lock" in VSCODE
I am using VSCODE in order to write cobol. We are being pressured to move off of our legacy software. That being said, this one thing has infuriated me to no end: Cobol Tags.
I have done extensive ...
0
votes
0
answers
123
views
z/OS DB2 version 13: how to detect a rollback in a mainframe batch environment execution
A SQL statement that returns an sqlcode -911 causes the rollback of the current unit of work (https://www.ibm.com/docs/en/db2-for-zos/13.0.0?topic=codes-911).
Suppose we have a main COBOL program that ...
0
votes
3
answers
135
views
How does GO TO influence the control flow
I am new to COBOL/Mainframes in general, I am just looking into the legacy code and trying to understand the control flow. Can you please explain how GO TO influence the control flow in the below ...
1
vote
2
answers
146
views
How to check variable for LOW-VALUE/SPACES from DEPENDING ON?
I have changed an OCCURS from constant number of elements to dynamic (DEPENDING ON):
01 OCC-VAL PIC 9(02) COMP VALUE 80.
01 TEMP-TABLE.
05 TABLE-OCC-OUT OCCURS 999 TIMES.
...
Advice
0
votes
2
replies
48
views
memory allocation for linkage section in MF Visual Cobol
Microfocus Visual Cobol sub-program has a declaration in linkage section as below.
01 VAR1 EXTERNAL.
03 VAR1A.
05 VAR1B PIC X OCCURS 8500000 TIMES
INDEXD BY INDEX-VAR1.
...
0
votes
1
answer
130
views
How to use the SORT statement with a 2D-table in COBOL?
I have the following data structure:
01 01 TABLE-01.
03 TABLE-03 OCCURS 5 TIMES.
05 TABLE-05 OCCURS 10 TIMES.
07 KEY-VAR PIC X(05).
07 SM-ELEM PIC X(04).
I need to use the SORT ...
1
vote
2
answers
181
views
How to use copybooks for COBOL programm using CICS and DB2?
I am learning COBOL, CICS, and DB2. To that end, I created a program that implements a pseudo-transactional CICS process and interacts with DB2. The transaction works quite well, but the program ...
2
votes
2
answers
123
views
Passing a pointer to PIC X by value VS passing a PIC X by reference
Reasoning as a C programmer, I wonder why these two ways of calling a program are not equivalent. The first way works properly, however the second one does not.
The platform is IBM z/OS by the way.
* ...
2
votes
3
answers
152
views
Initial value of WORKING-STORAGE data-items
On IBM Enterprise COBOL for z/OS v6.1.0, I cannot seem to find any information about the initialization (or non-initialization) of data-items in the WORKING-STORAGE section that do not have a VALUE ...
1
vote
2
answers
176
views
Removing trailing space in COBOL
I'm trying to autogenerate some COBOL code.
IDENTIFICATION DIVISION.
PROGRAM-ID. Generator.
AUTHOR. Scimitaria.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
...
3
votes
2
answers
197
views
Quick Sort in GNU COBOL produces invalid result
I am trying to implement Quick Sort in GNU COBOL (version 3.2.2) using a recursive subprogram.
The sorting logic is standard and works perfectly in other languages (C, Python), but when I run it in ...
3
votes
1
answer
80
views
Issue Using JSON_TABLE with CLOB in IBM i COBOL
I am encountering an issue when using JSON_TABLE in IBM i COBOL with CLOB data. Below is an example of the code I am using:
EXEC SQL
DECLARE C_EMP CURSOR FOR
SELECT U.FIRSTNAME, U.PHONETYPE
...
2
votes
1
answer
147
views
Why does the SECURE Clause give me this display errors
I'm working on a login system for my project and I successfully made the login work. Now, when I tried to implement password masking using secure to asterisk the inputted password, it goes as intended....
2
votes
1
answer
87
views
In COBOL COMP variables, what is the meaning of the parenthetical number?
I understand that PIC S9(4) COMP is a 2-byte variable whose value is bounded by +/- 32,768 and that PIC S9(9) COMP is a 4-byte variable whose value is bounded by +/- 2,147,483,648.
What does the ...
0
votes
1
answer
124
views
@ not recognized by cobol z open editor WHY?
I am writing a Cobol program in Visual Studio Code using the STRING and UNSTRING statements but for some reason when trying to use string functions on email addresses the Cobol program will not ...