On 7/22/2021 8:29 AM, Peggy Quan wrote:
On Wednesday, July 21, 2021 at 3:33:35 PM UTC-4, andrean...@gmail.com wrote:
Does anyone know of any ALGOL / COBOL / WFL code that would fetch the job name if given the mix number? As part of a bigger project, I need the ability to submit a mix number, and have it return the object name for the task with that mix number. Has
anyone done anything like this, or have any example code I could use?
Any help would be appreciated!
Using aseries_info call would be your best bet. there are good examples in the manual (mcp interfaces)
There are a few APIs you can use to do this, including ASERIES_INFO that
Peggy mentioned. None of them are trivial to use, and all of them
require Algol skills.
I've put together a simple DCALGOL library that can be called from ALGOL
or COBOL and will retrieve both the task and job names given the mix
number of the task. I've put the source code in a zip archive that you
can download from here:
https://drive.google.com/file/d/1WbHOjLRmTvO-de_gmnA1mACZw01hnMsS/view?usp=sharing
This file has the source of the library and a small test program in PWB
text file format, plus a WRAP container with the two sources as MCP files.
The library (UTIL/TASKNAMELIB) has one entry point:
INTEGER PROCEDURE GETTASKNAMES(MIXNR, TASKNAME, TASKNAMESIZE,
JOBNR, JOBNAME, JOBNAMESIZE);
TASKNAME and JOBNAME are EBCDIC ARRAYS; MIXNR, TASKNAMESIZE, JOBNR, and JOBNAMESIZE are all integers passed by name (actually, by reference).
You pass in the mix number of a task and the routine returns the other
five values. The procedure value is 1 if an error occurred, zero
otherwise. See the comments in the source for other details.
The library uses the SYSTEMSTATUS API to retrieve mix information. This
use of SYSTEMSTATUS does not appear to require a privileged user. Note
that SYSTEMSTATUS reports information directly from MCP tables, so the
format of the data it returns can change across system releases. You may
need to verify the library's use of the data when you install a new
release, but this aspect of the API appears to have been very stable for
the past several years.
The test program is written in COBOL-85, but the library can be used
with COBOL-74 as well. The program simply retrieves the names for its
own mix number. Note that if you run this under CANDE or MARC, you'll
get non-fatal SYSTEMSTATUS error #33 when the library attempts to
retrieve the job name. The reason is that the "job" in this case is the session, which doesn't have a name. When I ran the program, I got this
output:
MIX# 4945, JOB# 4944, TASK NAME SIZE 29, JOB NAME SIZE 14 (PAUL)CANDE/NXEDIT/CODE49122.
TASKNAME/TEST.
The first line formats the integer parameters, the second line is the
task name, and the third line is the job name.
The library is very straightforward and does nothing to protect you from yourself. In particular, you need to take care that the arrays passed in
for task and job names are large enough, as the library does not resize
them. I'd recommend 256 characters minimum, and 300 if you have quoted
nodes in file names.
Feel free to contact me directly if you have any questions or issues
with this code.
Paul
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)