Consider the following example, in which ProgA and ProgB are entry names of procedures resident on disk:
1 fetch ProgA;
2 call ProgA;
3 release ProgA;
4 call ProgB;
go to Fin;
1 ProgA is loaded into main storage by the first FETCH statement.
2 ProgA executes when the first CALL statement is reached.
3 Storage for ProgA is released when the RELEASE statement is executed.
4 ProgB is loaded and executed when the second CALL statement is reached, even though the FETCH statement referring to this procedure is never executed.
The same results would be achieved if the statement FETCH ProgA were omitted. The appearance of ProgA in a RELEASE statement causes the statement CALL ProgA to load the procedure, as well as invoke it.
The fetched procedure is compiled and linked separately from the calling procedure. You must ensure that the entry constant specified in FETCH, RELEASE, and CALL statements; CALL options; and in function references is the name known on the disk. This is discussed in the Programming Guide