Priority queue: Difference between revisions

m
Minor edits to notes.
imported>Pjfarley3
m (Removed unnecessary LINKAGE SECTION structures from test program.)
imported>Pjfarley3
m (Minor edits to notes.)
Line 2,405:
In the "two pass merge" subroutine (PTYQ2PMG), the final three lines are needed because without using "user defined functions" the arguments to the outer call to the "merge" subroutine must be executed first, and the results of those two calls become the arguments to the final "merge" call.
 
Note also that the subroutines call each other using "PIC X(8)" pseudonym'spseudonyms because the actually recursive subroutines cannot use the "same name" as both the PROGRAM-ID and as a variable name. This could be resolved by simply using "constant" calls (like <code>CALL "PTYQ2PMG" usingUSING . . . </code> but using the pseudonym'spseudonyms allows each of the subroutines to also be separately compiled into an executable module and then dynamically loaded at run time. Many IBM shops will prefer that method to this purely "static" solution.
 
<syntaxhighlight lang="COBOL">
Anonymous user