FORK Examples
Example 1:
DEVNULL
INIT
"/dev/null"
.
MAIN
...........
CALL
FORKSUB
;Record retrieval routine
GOTO
FORK
DEVNULL,DEVNULL
FORKERR IF ZERO
;ZERO indicates failed
RETURN
IF NOT OVER
;NOT OVER = Parent
CHILD
SPLOPEN
"PRTFILE","Q"
;OPEN the spool file
PRINT
.............
;Actual PRINT routine
SPLCLOSE
SHUTDOWN
;terminate CHILD
Example 2:
CHAIN
"NEXTPROG"
:FORK continues until
;NOT OVER = parent