The following figure shows an example of data description specifications for a subfile control-record format. For an example of using a subfile in an RPG program, see Search by Zip Code.
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*
AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++++*
A R FILCTL SFLCTL(SUBFIL)
A N70 SFLCLR
A 70 SFLDSPCTL
A 71 SFLDSP
A SFLSIZ(15)
A SFLPAG(15)
A TEXT('Subfile Control Record')
A OVERLAY
A 71 ROLLUP(97 'Continue Search')
A CA01(98 'End of Program')
A HELP(99 'Help Key')
A 1 2'Customer Name Search'
A 3 2'Search Code'
A SRHCOD R I 3 14PUTRETAIN
A 5 2'Number'
A 5 10'Name'
A 5 32'Address'
A 5 54'City'
A 5 76'State'
A*
In addition to the control information, the subfile control-record format also defines the constants to be used as column headings for the subfile record format.