Wednesday, December 7, 2011

How to identify if a CICS programs is called thru LINK or CALL

You can utilize the same sub-program, regardless of the access, via a LINK-API or CALL.

Upon initial entry into the sub-program and as the first statement, save the contents of EIBRSRCE in a WS field.

If the WS field content is equal to the sub-program's name, then you were accessed via a LINK-API, which forces you to return to the Linking program via a CICS RETURN. Otherwise, issue a GOBACK.

Remember, after the first CALL (not LINK) from the same Caller, the WS "VALUE" clauses are no longer in effect, leaving WS in its "Last Used State".

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.