Does the CALL statement and the LINK statement work the same way within the Easytrieve product?
search cancel

Does the CALL statement and the LINK statement work the same way within the Easytrieve product?

book

Article ID: 46894

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

Does the CALL statement and the LINK statement work the same way within the Easytrieve Report Generator product?

 

Environment

Easytrieve Report Generator, release 11.6

Resolution

LINK was never designed to be a substitute for the CALL. 

The CALL statement clearly documents that the RETURNS parameter is the return code from the called sub-program.

However, the GIVING parameter on the LINK statement is a returning parameter from the sub-program. This makes it capable of containing any field type including a string and does not limit it to only being the content of Reg 15. As such, a usage of the LINK could be to act more like a MODIFY File Exit where you can pass in data and have your program manipulate that data in some way and pass it back to Easytrieve.  

The CALL statement is documented in the Language Reference Guide, starting on page 53, with the USING and RETURNS parameters.

The LINK statement is also documented in the Language Reference Guide, starting on page 177, with the USING and GIVING parameters.