× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

I'm trying to use the DEQ instruction and i have a problem with keyed queue.
With sequential queue the code is ok but with keyed queue the time out is
reached without retrieving queue entry.

Here the code:

/*-------------------------------------------------------------------*/
/*?Entry Point
/*-------------------------------------------------------------------*/

ENTRY * (*ENTRY) EXT;

/*-------------------------------------------------------------------*/
/*?Template For Entry Parms
/*-------------------------------------------------------------------*/

DCL SPCPTR E_QUEUE@    PARM;
DCL SPCPTR E_MSG@      PARM;
DCL SPCPTR E_RET@      PARM;
DCL SPCPTR E_TYPE@     PARM;
DCL SPCPTR E_REL@      PARM;
DCL SPCPTR E_WAIT@     PARM;
DCL SPCPTR E_KEY@      PARM;
DCL SPCPTR E_DUMMY@    PARM;

DCL DD E_QUEUE     CHAR(   20) BAS(E_QUEUE@);
DCL DD E_MSG       CHAR(32767) BAS(E_MSG@);
DCL DD E_MSG$       BIN(    4) DEF(E_MSG) POS(  1);
DCL DD E_RET        PKD(    1) BAS(E_RET@);
DCL DD E_TYPE      CHAR(    1) BAS(E_TYPE@);
DCL DD E_REL       CHAR(    2) BAS(E_REL@);
DCL DD E_WAIT       BIN(    4) BAS(E_WAIT@);
DCL DD E_KEY       CHAR(  260) BAS(E_KEY@);
DCL DD E_KEY$       BIN(    4) DEF(E_KEY) POS(  1);
DCL DD E_DUMMY     CHAR(    1) BAS(E_DUMMY@);

DCL OL *ENTRY (E_QUEUE@,
               E_MSG@,
               E_RET@,
               E_TYPE@,
               E_REL@,
               E_WAIT@,
               E_KEY@,
               E_DUMMY@) PARM EXT;

/COPY MI_ERR1
/COPY MI_ERR2

/COPY MI_RSLV
/COPY M2_MITIME

/*-------------------------------------------------------------------*/
/*?Others Data
/*-------------------------------------------------------------------*/

DCL DD *USQ  CHAR(  2) AUTO INIT(X'0A02');
DCL SYSPTR *USQ_PTR@ AUTO;

DCL DD KEY$ BIN(  4) AUTO INIT(0);

DCL SPCPTR MESSAGE@ AUTO INIT(MESSAGE);
DCL DD MESSAGE CHAR(32767) AUTO BDRY(16);

DCL DD MSG_PREFIX CHAR(533) BDRY(16) AUTO;
DCL DD MSG_P_TS        CHAR(   8) DEF(MSG_PREFIX) POS(  1);
DCL DD MSG_P_WAITT     CHAR(   8) DEF(MSG_PREFIX) POS(  9);
DCL DD MSG_P_SOMSQ      BIN(   4) DEF(MSG_PREFIX) POS( 17);
DCL DD MSG_P_STATE     CHAR(   1) DEF(MSG_PREFIX) POS( 21);
DCL DD MSG_P_SKEY      CHAR( 256) DEF(MSG_PREFIX) POS( 22);
DCL DD MSG_P_MKEY      CHAR( 256) DEF(MSG_PREFIX) POS(278);

/*-------------------------------------------------------------------*/
/*?Starting Program
/*-------------------------------------------------------------------*/

CMPBLA(B) E_DUMMY,X'FA'/NEQ(EXIT);
CPYNV     E_RET,P'+0';

/*-------------------------------------------------------------------*/
/*?Resolve Pointer To Space
/*-------------------------------------------------------------------*/

CMPBLA(B) E_QUEUE(11:10),'*LIBL     '/EQ(RSL2);
CMPBLA(B) E_QUEUE(11:10),'QTEMP     '/EQ(RSL3);
RSL1:
CPYBLA    RSL_TYPE,*LIB;
CPYBLAP   RSL_NAME,E_QUEUE(11:10),' ';
RSLVSP    *LIB_PTR@,RSL_PTR,*,*;
CPYBLA    RSL_TYPE,*USQ;
CPYBLAP   RSL_NAME,E_QUEUE(01:10),' ';
RSLVSP    *USQ_PTR@,RSL_PTR,*LIB_PTR@,*;
B         QUEUE;

RSL2:
CPYBLA    RSL_TYPE,*USQ;
CPYBLAP   RSL_NAME,E_QUEUE(01:10),' ';
RSLVSP    *USQ_PTR@,RSL_PTR,*,*;
B         QUEUE;

RSL3:
CPYBLA    RSL_TYPE,*USQ;
CPYBLAP   RSL_NAME,E_QUEUE(01:10),' ';
RSLVSP    *USQ_PTR@,RSL_PTR,QTEMP@,*;
B         QUEUE;

/*-------------------------------------------------------------------*/
/*?Dequeue Message
/*-------------------------------------------------------------------*/

QUEUE:

DCL       EXCM _KEY EXCID(H'2401') BP(SKIP1) SKP;
MODEXCPD  _KEY,X'A000',X'01';
CPYNV     KEY$,E_KEY$;
SKIP1:
MODEXCPD  _KEY,X'2000',X'01';

CPYBREP   MSG_P_STATE,X'00';
CPYBREP   MSG_P_SKEY,' ';

SETBTS    MSG_P_STATE,0;
SETBTS    MSG_P_STATE,1;
SETBTS    MSG_P_STATE,2;

CMPNV(B)  E_WAIT,-1/NEQ(NOMAX);
SETBTS    MSG_P_STATE,3;
B         ENOMAX;
NOMAX:
CPYNV     XMI_SECONDS,E_WAIT;
CALLX     MITIME$@,MITIME$_OL,*;
CPYBLA    MSG_P_WAITT,XMI_RETURN;
ENOMAX:

CMPBLA(B) E_TYPE,'F'/EQ(DOF0001);
CMPNV(B)  KEY$,0/EQ(EXIT);
CPYBLA    MSG_P_SKEY,E_KEY(5:E_KEY$);

CMPBLA(B) E_REL,X'0010'/NEQ(ELF0001);
BLF0001:
OR(S)     MSG_P_STATE ,X'02';
B         DOF0001;
ELF0001:

CMPBLA(B) E_REL,X'0100'/NEQ(ELF0002);
BLF0002:
OR(S)     MSG_P_STATE ,X'04';
B         DOF0001;
ELF0002:

CMPBLA(B) E_REL,X'0110'/NEQ(ELF0003);
BLF0003:
OR(S)     MSG_P_STATE ,X'06';
B         DOF0001;
ELF0003:

CMPBLA(B) E_REL,X'1000'/NEQ(ELF0004);
BLF0004:
OR(S)     MSG_P_STATE ,X'08';
B         DOF0001;
ELF0004:

CMPBLA(B) E_REL,X'1010'/NEQ(ELF0005);
BLF0005:
OR(S)     MSG_P_STATE ,X'0A';
B         DOF0001;
ELF0005:

CMPBLA(B) E_REL,X'1100'/NEQ(EXIT);
BLF0006:
OR(S)     MSG_P_STATE ,X'0C';
B         DOF0001;
ELF0006:

DOF0001:
BRK '100';
DEQ       MSG_PREFIX,MESSAGE@,*USQ_PTR@;

CMPNV(B)  MSG_P_SOMSQ,0/EQ(EXIT);
CPYNV     E_RET,P'+1';
CPYBLA    E_MSG(5:E_MSG$),MESSAGE(1:MSG_P_SOMSQ);

/*-------------------------------------------------------------------*/
/*?Exit Program
/*-------------------------------------------------------------------*/

EXIT:
DEACTPG *;
RTX *;

/COPY MI_EXCM
/COPY MI_HNDL


If someone could take a look and find where is the problem it will be fine.

Regards

Philippe

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.