OpenVMS DCL calls and “Callbacks”

This sample code was the subject of “”, the December 30, 2010 installment of The OpenVMS Consultant, a column on OpenVMS computing hosted by OpenVMS.org.

User exit routines, also referred to as “call-backs”, are a technique with a long history. Personally, I encountered them more than three decades ago, when using working with the SORT/MERGE utility included as part of IBM's OS/360. According to my recollection, OS/360 SORT/MERGE provided user-callbacks (referred to as “exit routines” at various stages in processing, including record-by-record calls during the input and output phases. This allowed applications to be constructed as input/output filters for the standard SORT/MERGE utility.

Call-backs have been extensively used in a variety of other contexts to provide additional processing not provided within a package (e.g., Xlib).

In OpenVMS DCL, callbacks take two forms:

In DCL, callbacks are useful for their ability to reduce duplication of common processing. It is not unusual to have many procedures that perform similar functions. Callbacks provide a way to elaborate on a processing theme without replicating the underlying code. This allows for easier maintenance and reduced costs.

The three DCL command files comprising this example may be downloaded from this page. For your convenience, the files have been packaged in a ZIP archive.

 
HP OpenVMS 30th Anniversary Logo
The downloadable ZIP archive contains three example command files:

OPENVMS-CALLBACK-EXAMPLE1.COM This procedure executes two procedures, using different mechanisms. The first procedure is called as a library procedure from the same directory, a useful technique for invoking external DCL subroutines. The second procedure is supplied as a parameter, and is executed from the present default directory.
OPENVMS-CALLBACK-EXAMPLE2.COM This procedure displays that it is being executed. It is admittedly a stub for more extensive processing.
OPENVMS-CALLBACK-EXAMPLE3.COM This procedure displays that it is being executed. It is admittedly a stub for more extensive processing.


Download Callback Examples (OpenVMS ZIP Archive)

References

  • Robert Gezelter “DCL Symbols: Starting at the beginning” The OpenVMS Consultant, OpenVMS.org, March 2, 2009, Retrieved from http://www.openvms.org/stories.php?story=09/03/02/8398294 on July 8,#2010.
  • Robert Gezelter “Logical Names: Part 5” The OpenVMS Consultant, OpenVMS.org, March 3, 2003, Retrieved from http://www.openvms.org/stories.php?story=03/03/03/4358185 on July 8,#2010.
  • Robert Gezelter “Logical Names: Part 4” The OpenVMS Consultant, OpenVMS.org, February 6, 2003, Retrieved from http://www.openvms.org/stories.php?story=03/02/06/8131783 on July 8,#2010.
  • Robert Gezelter “Logical Names: Part 3” The OpenVMS Consultant, OpenVMS.org, November 4, 2002, Retrieved from http://www.openvms.org/stories.php?story=02/11/04/2738906 on July 8,#2010.
  • Robert Gezelter “Logical Names: Part 2” The OpenVMS Consultant, OpenVMS.org, October 17, 2002, Retrieved from http://www.openvms.org/stories.php?story=02/10/17/9372652 on July 8,#2010.
  • Robert Gezelter “Logical Names: Part 1” The OpenVMS Consultant, OpenVMS.org, September 24, 2002, Retrieved from http://www.openvms.org/stories.php?story=02/09/24/5441505 on March 11,#2010.
  • Picture of Robert Gezelter, CDP
    Bringing Details into Focus, Focused Innovation, Focused Solutions
    RLGSC Logo
    http://www.rlgsc.com
    +1 (718) 463 1079