Example 1
Prmain: procedure;
declare Name character (20),
Item bit(5),
4 Outsub entry;
1 call Outsub (Name, Item);
end Prmain;
2 Outsub: procedure (A,B);
declare A character (20),
B bit(5);
3 put list (A,B);
end Outsub;
- 1
- The CALL statement in Prmain invokes the procedure Outsub in 2 with the arguments Name and Item.
- 2
- Outsub associates Name and Item passed from Prmain with its parameters, A and B. When Outsub is executed, each reference to A is treated as a reference to Name. Each reference to B is treated as a reference to Item.
- 3
- The put list (A,B) statement transmits the values of Name and Item to the default output file, SYSPRINT.
- 4
- In the declaration of Outsub as an entry constant, no parameter descriptor has to be given
with the ENTRY attribute, because the attributes of the arguments and
parameters match. Also see ENTRY attribute.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)