TechTalk: Reading Multiple Subfile Records

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

Reading Multiple Subfile Records

Q. Is there a way to allow entry above, in, and below a subfile at the same time? I can do above and in, but have problems when I try to add below. Any suggestions?

A. One little-known fact about RPG is that it can process several READ op codes simultaneously. You can take advantage of this feature in your situation.

Suppose you name your subfile control record SFLCTL. Above it, there's an input-capable record named ABOVE, and below it is another called BELOW.

Code your RPG program as shown in 5.

Code your RPG program as shown in Figure 5.

You can do this in any order that makes sense to you and be sure that all input-capable fields in all three records (SFLCTL, ABOVE and BELOW) will be processed by the program.


TechTalk: Reading Multiple Subfile Records

Figure 5 Reading multiple subfile records

 Figure 5: Reading Multiple Subfile Records ....+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 C WRITEABOVE C WRITEBELOW C EXFMTSFLCTL C READ ABOVE 90 C READ BELOW 91 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$