Program Messages and DDS Windows

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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' ' 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: