I have written a simple program that uses a message subfile. However the messages are not displaying. Can you please have a look at the code and help?
DDS:
A DSPSIZ(24 80 *DS3)
A CA03(03)
A CA12(12)
A INDARA
A* ===========================================================
A R SCREEN1
A 1 73DATE
A EDTCDE(Y)
A 2 73TIME
A 1 5USER
A 1 29'Message SubFile Example'
A COLOR(WHT)
A 5 6'Type a first Name and a last Name -
A and Press Enter to test'
A COLOR(BLU)
A 8 8'Enter First Name..........'
A FIRST_NAME 20A B 8 35CHECK(LC)
A EDTCDE(Y)
A 2 73TIME
A 1 5USER
A 1 29'Message SubFile Example'
A COLOR(WHT)
A 5 6'Type a first Name and a last Name -
A and Press Enter to test'
A COLOR(BLU)
A 8 8'Enter First Name..........'
A FIRST_NAME 20A B 8 35CHECK(LC)
A 10 8'Enter'
A 10 14'Last'
A 10 19'Name...........'
A LAST_NAME 20A B 10 35CHECK(LC)
A* 22 3'F3=Exit'
A* COLOR(BLU)
A* 22 13'F12=Cancel'
A* COLOR(BLU)
A 2 5'*sys'
A* ===========================================================
A R MSGSBFL SFL
A SFLMSGRCD(22)
A MSGKEY SFLMSGKEY
A SDS_PROC SFLPGMQ(10)
A* ===========================================================
A R MSGSBCTL SFLCTL(MSGSBFL)
A SFLSIZ(0002)
A SFLPAG(0001)
A SFLDSP
A SFLDSPCTL
A SDS_PROC SFLPGMQ(10)
RPG Code:
FMSGSBFL1 CF E WorkStn INDDS(INDDS)
DINDDS DS
DEXIT 3 3N
DCANCEL 12 12N
DPSDS SDS
D SDS_PROC 1 10
DMsgId S 7A
DMsgLoc S 20A Inz('SFLMSGF *LIBL ')
DMsgRplDta S 1A Inz(' ')
DMsgRplDtaLen S 4B 0 Inz(0)
DMsgType S 10A Inz('*DIAG')
DMsgQueue S 276A Inz('*')
DMsgCallStack S 4B 0 Inz(0)
DMsgKey S 4A Inz(' ')
DMsgErr S 4B 0 Inz(0)
DMsgrmv S 10A INZ('*ALL')
DMsgId S 7A
DMsgLoc S 20A Inz('SFLMSGF *LIBL ')
DMsgRplDta S 1A Inz(' ')
DMsgRplDtaLen S 4B 0 Inz(0)
DMsgType S 10A Inz('*DIAG')
DMsgQueue S 276A Inz('*')
DMsgCallStack S 4B 0 Inz(0)
DMsgKey S 4A Inz(' ')
DMsgErr S 4B 0 Inz(0)
DMsgrmv S 10A INZ('*ALL')
/Free
DoU Exit or Cancel;
Write Msgsbctl;
Exfmt Screen1;
MsgKey = *Blanks;
Exsr RcvMsg;
If First_Name <> 'Thejwal';
MsgId = 'SFL0001';
Exsr SndMsg;
EndIf;
If Last_Name <> 'Pavithran';
MsgId = 'SFL0002';
Exsr SndMsg;
EndIf;
EndDo;
*Inlr = *on;
C SndMsg Begsr
C CALL 'QMHSNDPM'
C PARM MsgId
C PARM MsgLoc
C PARM MsgRplDta
C PARM MsgRplDtaLen
C PARM MsgType
C PARM MsgQueue
C PARM MsgCallStack
C PARM MsgKey
C PARM MsgErr
C Endsr
C RcvMsg Begsr
C CALL 'QMHRMVPM'
C PARM MsgQueue
C PARM MsgCallStack
C PARM MsgKey
C PARM MsgRmv
C PARM MsgErr
C Endsr
I can see that the messages are displaying in thew Job log but for some reason it is not showing up on the screen. I am not sure if the DDS is at fault or if the messages are not being sent to the correct program queue. Please help
I got the answer!!! the issue was that i had missed the overlay keyword for the Screen1 record format. What a relief :)