"VGET (ZPF05) PROFILE" save_f5 = zpf05 do forever zpf05 = "END" ; "VPUT (ZPF05) PROFILE" "TBDISPL" ... disp_rc = rc zpf05 = save_f5; "VPUT (ZPF05) PROFILE" if disp_rc > 8 then do zerrlm = exec_name "("BRANCH("ID")")", zerrlm "SETMSG MSG(ISRZ002)" sw.0error_found = "1" leave end if disp_rc = 8 then, if pfkey = "F5" then call Z_REFIND /* -*/ else leave if zcmd <> "" then do call BDC_ZCMD /* -*/ end ; else, do ztdsels end /* ztdsels */ action = "" /* clear for re-display */ end /* forever */ return /*@ BD_SHOW_TABLE */ /* . ----------------------------------------------------------------- */ BDC_ZCMD: /*@ */ if branch then call BRANCH address ISPEXEC parse var zcmd verb text if Wordpos(Left(verb,1),"F L") > 0 then do parse var text fld . "=" val . "TBVCLEAR" tblid @z@ = Value(fld,val"*") /* load value */ "TBSARG" tblid "NAMECOND("fld",EQ)" "TBTOP" tblid call Z_TBSCAN /* -*/ end /* L LOCATE F FIND */ return /*@ BDC_ZCMD */ /* Position the cursor, then TBSCAN . ----------------------------------------------------------------- */ Z_REFIND: /*@ */ if branch then call BRANCH address ISPEXEC "TBSKIP" tblid "ROW("lastfnd") NOREAD" call Z_TBSCAN /* -*/ pfkey = "" /* prevent re-use */ return /*@ Z_REFIND */ /* The table is positioned to find a row and the argument is set. . ----------------------------------------------------------------- */ Z_TBSCAN: /*@ */ if branch then call BRANCH address ISPEXEC "TBSCAN" @tn@ "ROWID(LASTFND) POSITION(LASTCRP)" /* set LASTFND and LASTCRP if successful */ if rc = 8 then do /* not found */ zerrsm = "Not found" if pfkey = "F5" then, zerrlm = "End of table encountered." else, zerrlm = "No rows found to match" fld"="val zerrlm = exec_name "("BRANCH("ID")")", zerrlm address ISPEXEC "SETMSG MSG(ISRZ002)" end /* not found */ "TBSKIP" @tn@ "ROW("lastfnd") NOREAD" /* position to LASTFND */ return /*@ Z_TBSCAN */