What I'm trying to do is executing a TSO command from within a COBOL program executing in Batch environment; what I do first is to create a TSO environment calling IKJTSOEV; after successful completion (RETURN CODE=0) I use TSOLNK routine to execute a TSO command.
The problem arises in this second call, I get ikj56637I error. If I consult IBM manual, it says :
IKJ56637I You attempted to run a command, program, CLIST, or REXX exec from an authorized environment. This is not supported under the dynamic TSO/E environment. Explanation: You are running in an address space with a TSO/E environment created by the TSO/E environment service. You asked to use the TSO/E service facility to invoke a command, program, CLIST, or REXX exec from an authorized TSO/E environment. This function is not available in this environment.
May I receive some explanation about what is happening and how can I manage to solve this and have my COBOL program executed?.
Many thanks in advance
Do you really need to run TSO from Cobol ???
If you do try:
This should work but there is probably a better way. Just running your Cobol program under TSO may work.
I am not sure that running lots of TSO steps in a Cobol program is a good idea. An alternative approach like:
might work better.
For running ISPF batch Google ISPF Batch, you will find responses like Batch Ispf
In your program you would use the
ISPF SELECT CMDservice to call TSO. TheISPF Editcommand model will generate a sample ISPF calls for you.Basically In cobol you would do
where command-var holds 'CMD(Your-command)'
This thread has a Cobol program calling ISPF