Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Locking a Data Area

578 views
Skip to first unread message

Unknown

unread,
Apr 24, 1996, 3:00:00 AM4/24/96
to
Hello,
I am currently writing a small program on V3R1 to lock a Data Area, read the value, increment the value, write it out, and
unlock the value. I have no problem with the read, update, and write operations, but I get an error message when I try to Lock the
data area. The name of the data area is ZSEQ and I recieve the following error when I try to lock this object:

"Object Domain error for object ZSEQ."
"Application error. MCH6801 unmonitored by QC2UTIL1 at statement 0000000010, instruction X'000'."

I can successfully lock a Program object, but the data area doesn't seem to work. Does anyone know how to lock a data area on a
V3R1 machine?

Below is the program:
#include <stdio.h>
#include <stdlib.h>
#include <milib.h>
#include <milock.h>
#include <miptrnam.h>
#include <xxdtaa.h>
#include <string.h>

#define DTA_SIZE 10
#define DTA_NAME "ZSEQ "
#define DTA_LIB "BUILD "

void main (void)
{
_SYSPTR dtaara;
_MI_Time timeout;
int hours = 0,
min = 1,
sec = 0,
hund = 0;
_DTAA_NAME_T dtaname;
char dtaptr[DTA_SIZE + 1];
long value = 0;

dtaara = rslvsp (0x190A, "ZSEQ","BUILD", _AUTH_ALL);
/*
dtaara = rslvsp (_Program, "REGUTIL","BUILD", _AUTH_ALL);
*/
mitime (&timeout, hours, min, sec, hund);

lock (dtaara, timeout, _LENR_LOCK);

strcpy (dtaname.dtaa_name, DTA_NAME);
strcpy (dtaname.dtaa_lib, DTA_LIB);
QXXRTVDA (dtaname, 1, DTA_SIZE, dtaptr);
value = atol(dtaptr);
value++;
sprintf (dtaptr, "%010ld", value);
QXXCHGDA (dtaname, 1, DTA_SIZE, dtaptr);

unlock (dtaara, _UNLOCK_SPECIFIC, _LENR_LOCK);
}

Thanks in Advance...
--Chris
(opinions, comments, etc. stated are not necessarily those of my employer)

George Timms

unread,
Apr 25, 1996, 3:00:00 AM4/25/96
to
In article <DqD84...@tigger.jvnc.net>, Chris Zangrilli (ver...@tigger.jvnc.net) writes:
|> Hello,
|> I am currently writing a small program on V3R1 to lock a Data Area, read the value, increment the value, write it out, and
|> unlock the value. I have no problem with the read, update, and write operations, but I get an error message when I try to Lock the
|> data area. The name of the data area is ZSEQ and I recieve the following error when I try to lock this object:
|>
|> "Object Domain error for object ZSEQ."
|> "Application error. MCH6801 unmonitored by QC2UTIL1 at statement 0000000010, instruction X'000'."
|>
|> I can successfully lock a Program object, but the data area doesn't seem to work. Does anyone know how to lock a data area on a
|> V3R1 machine?

At least at security level 40 (and possibly other levels too), you can
only use the MI lock instruction against user-domain objects. Most
objects are system-domain (including object type *DTAARA).

You can use the LCKOBJ CL command to lock a data area (and you can run
the CL command with the system() C runtime routine). I don't know if
there is a system API to the LCKOBJ command functionality (avoiding
command analyzer overhead).

--
Standard disclaimer: Not speaking for IBM
George Timms Internet: ti...@vnet.ibm.com
IBM AS/400 Division Rochester, MN 55901

Message has been deleted

manoj datt

unread,
Oct 10, 2022, 11:39:35 AM10/10/22
to
For the same objective, I 'm facing issue of xxdtaa.h not found.

Any idea why getting not found?
0 new messages