"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)
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