Thanks for the help. In several practical experiments, it was found that running REXX from JCL does not block the terminal at run time.
What I got:
1) JCL(No.1) REXX runs:
//REXXJOB JOB MSGLEVEL=(1,1),MSGCLASS=A,CLASS=A,REGION=0M
//S1 EXEC PGM=IKJEFT01,REGION=0M,
// PARM='REXXEXAM'
//SYSEXEC DD DISP=SHR,DSN=xxxx.xxx.xxx
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//CARDS DD DSN=xxxx.xxx.xxx(xxxxxx),
// DISP=SHR,UNIT=SYSDA,VOL=SER=xxxxxx
(Here dopoledne lines are not important are left - overs from other jobs)
2) REXX(in the original first changing the control card JCL No. 2) starts a simple task in which a single step is the expectation(simulation performance), and waits for the job to finish(checking every 10 seconds):
/******************************** REXX *****************************/
DSNA = "'BELV.PRC.JCL(EXAMPLE)'"
ADDRESS TSO
X = OUTTRAP('LOG.')
"SUB "DSNA
X = OUTTRAP('OFF')
PARSE VAR LOG.1 "JOB" JOBNAME "("JOBID")" MESSAGE
ADDRESS TSO
X = OUTTRAP('LOG.')
"TSO STATUS "JOBNAME"("JOBID")"
X = OUTTRAP('OFF')
Y = LOG.1
PASSWORD = Y
Z = 0
DO UNTIL Z \= PASSWORD
ADDRESS TSO
X = OUTTRAP('LOG.')
"TSO STATUS "JOBNAME"("JOBID")"
X = OUTTRAP('OFF')
Z = LOG.1
CALL SYSCALLS('ON') /*ENABLE USS-CALLS*/
ADDRESS SYSCALL
"SLEEP" 10 /*SLEEP FOR ?? SECONDS*/
CALL SYSCALLS 'OFF'
TIME = TIME +1
END
In the end, if the JCL No. 1 with the start REXX, the next step will be to wait for the end JCL No. 2(which starts in REXX).
(requires clarification - this example was run on the test machine, which almost does not feel pressure. if you are going to use it, pay attention to the process of assigning values to the variable PASSWORD)
Maybe it will help someone.
Also would be happy to explore options with SDSF API, if anyone can suggest what to look for from the tools API.