Loading

JOB statement with START and FINISH procs in Easytrieve

Consider reading about JOB INPUT statements and PROCs in Easytrieve to know about JOB and PROC in easytrieve (not the usual JOB and PROC in JCL !).

 LIST ON
 JOB INPUT NULL START BEGIN-PROC FINISH FINAL-PROC
   PERFORM MID-PROC
   DISPLAY ' IN THE JOB '
 STOP
*
 BEGIN-PROC. PROC
   DISPLAY ' STARTING ..'
 END-PROC
*
 FINAL-PROC. PROC
   DISPLAY ' ENDING ..'
 END-PROC
*
 MID-PROC. PROC
   DISPLAY ' MIDDLE ..'
 END-PROC
*

In the above program, BEGIN-PROC will execute first (before starting the JOB block) and FINAL-PROC will be executed after the JOB statements are complete. hence, output of this program will look like,

 STARTING ..
 MIDDLE ..
 IN THE JOB
 ENDING ..

Related Posts




blog comments powered by Disqus

There's 6 Comments So Far

Share your thoughts, leave a comment!