Q: I have written a couple of programs using the DDS WINDOW keyword. I enjoy its ease of use and flexibility; however, I can't get my program-controlled messages to appear in the last line of the window. Is this even possible?
A: I've included a sample display file source member (see 2) that I think you'll find helpful. It illustrates how to place subfile messages in your windows. Be sure your program moves an asterisk (*) to the first position of the PGMQ field in its initialization subroutine. The special asterisk value causes OS/400 to automatically supply the name of the program message queue used by the program to build the message subfile. This eliminates the need to hard-code a message queue name.
A: I've included a sample display file source member (see Figure 2) that I think you'll find helpful. It illustrates how to place subfile messages in your windows. Be sure your program moves an asterisk (*) to the first position of the PGMQ field in its initialization subroutine. The special asterisk value causes OS/400 to automatically supply the name of the program message queue used by the program to build the message subfile. This eliminates the need to hard-code a message queue name.
Program Messages and DDS Windows
Figure 2 Sample DSPF Source with a Message Subfile Line
A*=============================================================== A* To compile: A* A* CRTDSPF FILE(XXX/XES001DF) SRCFILE(XXX/QDDSSRC) A* A*=============================================================== A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A DSPSIZ(24 80 *DS3) A PRINT A CA03(03) A R WIND1 A WINDOW(4 6 8 50) A OVERLAY A 1 18'CONFIRM' A TXT 11A O 1 26DSPATR(HI) A 3 4'TYPE "Y" TO CONTINUE' A 4 4'TYPE "N" TO CANCEL' A YESNO 1A B 6 29 A 6 32'Y/N' A*================================================================ A R MSGSFL SFL A SFLMSGRCD(07) A MSGKEY SFLMSGKEY A PGMQ SFLPGMQ(10) A*================================================================ A R MSGCTL SFLCTL(MSGSFL) A OVERLAY A SFLDSP A SFLDSPCTL A SFLINZ A N03 SFLEND A SFLSIZ(0002) A SFLPAG(0001) A WINDOW(WIND1) A PGMQ SFLPGMQ(10) A*================================================================ A R DUMMY A ASSUME A 1 2' '
LATEST COMMENTS
MC Press Online