iSeries / AS400 FAQ : Programming : RPG : How can I show a progress bar for a long running process?
Q. I want to display a progress bar (or “Working…” window) for a long-running interactive process. What I’m doing: SETON indicator for “CALCULATING” to display WRITE subfile control record (should display at this point) DO LOOP Nothing displays! A. John Carr submitted this in Jul 1997: I believe that if you have a display file which is DFRWRT(*NO) then whenever you do a WRITE to a format (maybe something like; WRITE HEADING WRITE CMDS WRITE MSGSFL EXFMT SFLCNTRL OS/400 will do each I/O IMMEDIATELY when the WRITE is encountered. Your program goes into a WAIT STATE (while still in an activity slot) each time this happens. VERY EXPENSIVE. (Especially remotely attached) It’s like taking the groceries out of the car into the house by carrying each item separately one at a time. If you do the same thing with the display file DFRWRT(*YES), OS/400 will “bundle up or buffer up” all the writes UNTIL it sees an Input/Output operation like a READ or EXFMT.
Q. I want to display a progress bar (or “Working…” window) for a long-running interactive process. What I’m doing: SETON indicator for “CALCULATING” to display WRITE subfile control record (should display at this point) DO LOOP Nothing displays! A. John Carr submitted this in Jul 1997: I believe that if you have a display file which is DFRWRT(*NO) then whenever you do a WRITE to a format (maybe something like; WRITE HEADING WRITE CMDS WRITE MSGSFL EXFMT SFLCNTRL OS/400 will do each I/O IMMEDIATELY when the WRITE is encountered. Your program goes into a WAIT STATE (while still in an activity slot) each time this happens. VERY EXPENSIVE. (Especially remotely attached) It’s like taking the groceries out of the car into the house by carrying each item separately one at a time. If you do the same thing with the display file DFRWRT(*YES), OS/400 will “bundle up or buffer up” all the writes UNTIL it sees an Input/Output operation like a READ or EXFMT. When it encounters that opcode it write
Related Questions
- iSeries / AS400 FAQ : (Category) Programming : (Category) RPG : How can I show a progress bar for a long running process?
- iSeries / AS400 FAQ : Programming : RPG : How do I check a users authority to files in the Root File System?
- iSeries / AS400 FAQ : Programming : RPG : How can I show a progress bar for a long running process?