Page 1 of 1

How to control which programs can call a subroutine?

PostPosted: Fri Nov 09, 2018 9:33 pm
by tivrfoa
Hi,

So, imagine I have subroutine S1, and 2 programs: P1 and P2.
Only P1 can call S1.
How would you handle that?

If I call with EXEC CICS LINK, is there a CICS variable that S1 can use that tells who called her, ie, the name of the caller program?

Thank you.

Re: How to control which programs can call a subroutine?

PostPosted: Fri Nov 09, 2018 10:43 pm
by Robert Sample
As long as P1 and P2 have different transaction identifiers, you can use EIBTRNID to distinguish between them. If they do not have different transaction identifiers, about all you could do would be to have P1 set a flag in a system resource (DFHCOMMAREA, TS QUEUE or FILE record would be the most obvious spots although others could be used) that S1 could use to determine if it was called by the right program.

CICS does not track which program called which other program. CICS knows if a LINK or XCTL was used since they can impact where a RETURN goes, but as far as which program did the LINK or XCTL, CICS doesn't know nor care. Depending upon your site's security package, you might be able to use it to restrict access to S1 -- but whether or not that is even possible would be a question for your site support group.