Function SET185C - Delete a Message

LANSA

Function SET185C - Delete a Message
FUNCTION OPTIONS(*DIRECT *DBOPTIMISE);
********** COMMENT(=======================================================);
********** COMMENT(This function is used to delete a message);
********** COMMENT(=======================================================);
********** COMMENT(---------------------------------------);
********** COMMENT(Look up the number session and number);
********** COMMENT(and convert to a message key);
********** COMMENT(---------------------------------------);
FETCH FIELDS(#S_185KEY) FROM_FILE(SETOMQ) WITH_KEY(#S_185SESI #S_185MSGN);
IF_STATUS IS_NOT(*OKAY);
MESSAGE MSGTXT('Message could not be found in file SETOMQ');
ELSE;
CHANGE FIELD(#S_185FON) TO(D);
CALL PGM(SETGETMSGQ) PARM(#S_185QUE #S_185FON #S_185KEY #S_185LVL1 #S_185MSGI #S_185SEV #S_185SEND #S_185RTNT) NUM_LEN(*DEFINED);
IF COND('#S_185RTNT *NE OK');
MESSAGE MSGTXT('Message could not be removed');
ELSE;
MESSAGE MSGTXT('Message has been removed');
ENDIF;
ENDIF;
********** COMMENT(--------);
********** COMMENT(Finished);
********** COMMENT(--------);
RETURN;