|
|
|
/* COPYRIGHT JÜRGEN REULE 2022-2023 */ |
|
|
|
|
|
|
|
|
PGM |
PARM(&DTAQDS &SUBMIT) |
|
|
|
|
|
|
|
|
DCL |
VAR(&DTAQDS) TYPE(*CHAR) LEN(20) |
|
|
|
DCL |
VAR(&DTAQ) TYPE(*CHAR) LEN(10) |
|
|
|
DCL |
VAR(&DTAQLIB) TYPE(*CHAR) LEN(10) |
|
|
|
DCL |
VAR(&SUBMIT) TYPE(*CHAR) LEN(1) |
|
|
|
DCL |
VAR(&HOUR) TYPE(*CHAR) LEN(2) |
|
|
|
DCL |
VAR(&HOURX) TYPE(*CHAR) LEN(2) |
|
|
|
DCL |
VAR(&X) TYPE(*CHAR) LEN(1) |
|
|
|
|
|
|
|
|
MONMSG |
MSGID(CPF0000) |
|
|
|
|
|
|
|
|
CHGVAR |
VAR(&HOURX) VALUE('06') |
|
|
|
|
|
|
|
|
CHGVAR |
VAR(&DTAQ) VALUE(%SST(&DTAQDS 1 10)) |
|
|
|
CHGVAR |
VAR(&DTAQLIB) VALUE(%SST(&DTAQDS 11 10)) |
|
|
|
|
|
|
|
|
RTVSYSVAL |
SYSVAL(QHOUR) RTNVAR(&HOUR) |
|
|
|
RTVDTAARA |
DTAARA(ANFRAGE (1 2)) RTNVAR(&HOURX) |
|
|
|
|
|
|
|
|
CRTDTAQ |
DTAQ(&DTAQLIB/&DTAQ) MAXLEN(1500) + |
|
|
|
|
SIZE(*MAX2GB) AUTORCL(*YES) |
|
|
|
MONMSG |
MSGID(CPF0000) EXEC(RCVMSG MSGTYPE(*LAST) + |
|
|
|
|
WAIT(0) RMV(*YES)) |
|
|
|
IF |
COND(&SUBMIT *EQ '0') THEN(DO) |
|
|
|
ALCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *EXCL)) WAIT(0) |
|
|
|
MONMSG |
MSGID(CPF0000) EXEC(CHGVAR VAR(&X) VALUE('1')) |
|
|
|
IF |
COND(&X *EQ '1') THEN(RCVMSG MSGTYPE(*LAST) + |
|
|
|
|
WAIT(0) RMV(*YES)) |
|
|
|
ELSE |
CMD(DO) |
|
|
|
ALCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *SHRRD)) WAIT(0) |
|
|
|
DLCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *EXCL)) |
|
|
|
ANFRAGEN |
DTAQ(&DTAQLIB/&DTAQ) HOURX(&HOURX) |
|
|
|
DLCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *SHRRD)) |
|
|
|
ENDDO |
|
|
|
|
ENDDO |
|
|
|
|
|
|
|
|
|
IF |
COND(&SUBMIT *EQ '1') THEN(DO) |
|
|
|
ALCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *EXCL)) WAIT(0) |
|
|
|
MONMSG |
MSGID(CPF0000) EXEC(CHGVAR VAR(&X) VALUE('1')) |
|
|
|
IF |
COND(&X *EQ '1') THEN(RCVMSG MSGTYPE(*LAST) + |
|
|
|
|
WAIT(0) RMV(*YES)) |
|
|
|
ELSE |
CMD(DO) |
|
|
|
DLCOBJ |
OBJ((&DTAQLIB/&DTAQ *DTAQ *EXCL)) |
|
|
|
SBMJOB |
CMD(ANFRAGE DTAQ(&DTAQLIB/&DTAQ) + |
|
|
|
|
SUBMIT(*NO)) JOB(ANFRAGE) JOBQ(QCTL) + |
|
|
|
|
LOG(4 0 *NOLIST) LOGCLPGM(*NO) MSGQ(*NONE) |
|
|
|
ENDDO |
|
|
|
|
ENDDO |
|
|
|
ENDPGM: |
ENDPGM |
|
|