* * To compile: * * CRTRPGPGM PGM(XXX/SFL015RG) SRCFILE(XXX/QRPGLESRC) * *======================================================================= Fmultsfl1dfcf e workstn sfile(sfl1:rrn1) F sfile(sfl2:rrn2) F infds(info) Fsfl001lf if e k disk Dinfo ds D cfkey 369 369 D sflrrn 378 379B 0 Dexit C const(X'33') Dcancel C const(X'3C') Denter C const(X'F1') C exsr sflbld c dou (cfkey = exit) or (cfkey = cancel) C write header C write footer C write sf2ctl C write sf1ctl C read sf2ctl C read sf1ctl C select C when (cfkey = exit) or (cfkey = cancel) C eval *inlr = *on C endsl C enddo **************************************************************** C sflbld begsr *************************************************************** * * Load-all subfile. Clear both subfiles before loading. * C eval *in31 = *on C eval *in41 = *on C write sf1ctl C write sf2ctl C eval *in31 = *off C eval *in41 = *off C z-add 0 rrn1 C z-add 0 rrn2 * * Read the records from file and load both subfiles. * C *loval setll sfl001lf C read sfl001lf C dow not %eof C eval rrn1 = rrn1 + 1 C eval rrn2 = rrn2 + 1 C write sfl1 C write sfl2 C read sfl001lf C enddo * * Since we are reading from the same file, * just check rrn1 to determine empty subfiles. * C if rrn1 > 0 C eval *in32 = *on C eval *in42 = *on C eval rrn1 = 1 C eval rrn2 = 1 C endif * * SFLEND indicator * C eval *in90 = *on * C endsr