We have a COBOL program that writes to a data queue. In testing an expansion of the database, we get a condition in which the COBOL program writes too many entries to the data queue, resulting in escape message CPF950A to the job - "Storage limit exceeded for data queue XXXXXXXX in *LIBL" - and inquiry message LNR7200 to the operator message queue:
"Message 'CPF950A' in program object 'XXXXXXXX' in library 'YYYYYYYY' (C
D F G).".
I want to add a system reply list entry, but I want it to be specific to
the program that threw the error. The problem is that the message field values for LNR7200 are all specified as *VARY for length. The CMPDTA parameter of the ADDRPYLE command requires a fixed position in the
message data. The problem is the second parameter, which specifies the statement statement number in the COBOL program that received the error.
It is specified as *CHAR *VARY. That means I can't specify a fixed position for the start position of the comparison data parameter
(CMPDTA) for the reply list entry, because the statement number in the program may (will) vary.
Any suggestions?
Simple answer since this is program specific is don't use the replay list.it to use "G" or "D" or whatever - if you don't handle it then the normal green screen of death will appear.
COBOL has the ability to programatically catch and respond to such messages. You don't say if you are using COBOL/400 or ILE COBOL.
In ILE COBOL you will find the basic information in the section of the manual "Using Error Handling Bindable Application Programming Interfaces (APIs)" - for me that is on page 3-186 of the Programmers Guide.
Basically you register an error handler using QlnSetCobolErrorHandler and it will get control when an error occurs. Your routine decides how to respond to the message or chooses not to handle it depending on the message. If you handle it, by telling
There is an equivalent for COBOL/400 but I can't remember the names as it is too many years since I used that compiler.
Just a suggestion - but you'll get far more help fo COBOL on the COBOL list on midrange.com. There's really very little activity of any kind on this list and next to zero COBOL.
We have a COBOL program that writes to a data queue. In testing an expansion of the database, we get a condition in which the COBOL program writes too many entries to the data queue, resulting in escape message CPF950A to the job - "Storage limit exceeded for data queue XXXXXXXX in *LIBL" - and inquiry message LNR7200 to the operator message queue:
"Message 'CPF950A' in program object 'XXXXXXXX' in library 'YYYYYYYY' (C
D F G).".
I want to add a system reply list entry, but I want it to be specific to
the program that threw the error. The problem is that the message field values for LNR7200 are all specified as *VARY for length. The CMPDTA parameter of the ADDRPYLE command requires a fixed position in the
message data. The problem is the second parameter, which specifies the statement statement number in the COBOL program that received the error.
It is specified as *CHAR *VARY. That means I can't specify a fixed position for the start position of the comparison data parameter
(CMPDTA) for the reply list entry, because the statement number in the program may (will) vary.
Any suggestions?
On Wednesday, October 31, 2018 at 1:00:36 AM UTC-5, Jonathan Ball wrote:
We have a COBOL program that writes to a data queue. In testing an
expansion of the database, we get a condition in which the COBOL program
writes too many entries to the data queue, resulting in escape message
CPF950A to the job - "Storage limit exceeded for data queue XXXXXXXX in
*LIBL" - and inquiry message LNR7200 to the operator message queue:
"Message 'CPF950A' in program object 'XXXXXXXX' in library 'YYYYYYYY' (C
D F G).".
I want to add a system reply list entry, but I want it to be specific to
the program that threw the error. The problem is that the message field
values for LNR7200 are all specified as *VARY for length. The CMPDTA
parameter of the ADDRPYLE command requires a fixed position in the
message data. The problem is the second parameter, which specifies the
statement statement number in the COBOL program that received the error.
It is specified as *CHAR *VARY. That means I can't specify a fixed
position for the start position of the comparison data parameter
(CMPDTA) for the reply list entry, because the statement number in the
program may (will) vary.
Any suggestions?
Simple answer since this is program specific is don't use the replay list.
COBOL has the ability to programatically catch and respond to such messages. You don't say if you are using COBOL/400 or ILE COBOL.
In ILE COBOL you will find the basic information in the section of the manual "Using Error Handling Bindable Application Programming Interfaces (APIs)" - for me that is on page 3-186 of the Programmers Guide.it to use "G" or "D" or whatever - if you don't handle it then the normal green screen of death will appear.
Basically you register an error handler using QlnSetCobolErrorHandler and it will get control when an error occurs. Your routine decides how to respond to the message or chooses not to handle it depending on the message. If you handle it, by telling
There is an equivalent for COBOL/400 but I can't remember the names as it is too many years since I used that compiler.
Just a suggestion - but you'll get far more help fo COBOL on the COBOL list on midrange.com. There's really very little activity of any kind on this list and next to zero COBOL.
It's ILE.
Thanks for the rest of your reply. I stumbled upon that myself earlier today. The error handler registration looks a little daunting, but I
think I can handle it; I may come back with more questions. Writing the error handling program itself looks pretty easy; it's the registration
that looks tricky.
The reply list entry definitely is not going to work. Here is what I
was thinking with respect to calling QSNDDTAQ in the ILE COBOL program:
call "QSNDDTAQ" using
Dtaq-name
Dtaq-lib
Dtaq-fld-len
Data-queue-entry
on exception
[do some stuff]
not on exception
[do some other stuff]
end-call
When the data queue is full, the CPF950A error is returned from QSNDDTAQ
to my program, which then generates the LNR7200 inquiry message. For
some reason, the ON EXCEPTION code is never invoked. What I had hoped
to do was to have the reply list entry issue a 'C' to LNR7200; then the
ON EXCEPTION code would delay the job for a short while until the multi-threaded jobs could read enough entries off the data queue to
allow the driver program to resume writing entries to the data queue.
It doesn't work.
Thanks for the reply. Thanks also to Jonathan Bailey for his reply.
Crikey - he's a Jonathan, I'm a Jonathan, and I presume your 'Jon' is
short for Jonathan. I guess every IBM i developer with COBOL expertise
must be named Jonathan, eh? :-)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 69:47:50 |
Calls: | 6,655 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,332,101 |
Posted today: | 1 |