Hello Roger,
you could use this REXX to build environment and then drive ISPSTART.
It redrives the exec until the correct ISPF environment is active.
Regards
Bruce Hewson
/* REXX **************************************************************/
Trace 'o'
Signal on Novalue /* Clean diagnostics */
Signal on Syntax /* for unexpected results. */
/*===================================================================*/
Parse Source . . cmd . clib .
Parse Upper Arg datasetname .
/*********************************************************************/
/* Ensure ISPF dialog manangement services are available */
/*********************************************************************/
If 'SYSVAR'("SYSISPF") = "NOT ACTIVE" Then Do
"ISPSTART CMD(%" || cmd datasetname|| ") NEWAPPL(ISR)"
End
Else Do
address "ISPEXEC"
"VGET ZAPPLID SHARED"
If Strip(zapplid) ¬= "ISR" then do
If clib ¬= "?" Then Do
If Left(datasetname,1) = "'" Then Do
datasetname = "'" || datasetname || "'"
End
"SELECT CMD(EX '"clib"("cmd")' '"datasetname"') NEWAPPL(ISR) PASSLI
End
Else Do
"SELECT CMD(%"cmd datasetname") NEWAPPL(ISR) PASSLIB"
End
End
Else Do
system_name = Left('MVSVAR'("SYMDEF ","SYSNAME "),4)
Select
When Pos(system_name,"SYSA SYSB SYSC") > 0 Then Do
Nop
End
Otherwise Do
If Strip(datasetname) = "" Then Do
Address ISPEXEC
"VGET (PDSDSN) ASIS"
If rc = 0 Then datasetname = "'" || Strip(pdsdsn) || "'"
Else datasetname = "*"
End
End
End
Address TSO
msg_value = 'MSG'("OFF")
sysdsn_value = 'SYSDSN'( datasetname )
msg_value = 'MSG'(msg_value)
If Strip(sysdsn_value) = "OK" Then Do
"ALTLIB ACTIVATE APP(CLIST) DSN('SYS1.APPL01.CLIST')"
Address ISPEXEC
"LIBDEF ISPMLIB DATASET ID('SYS1.APPL01.MSGS')"
"LIBDEF ISPPLIB DATASET ID('SYS1.APPL01.PANELS')"
"LIBDEF ISPSLIB DATASET ID('SYS1.APPL01.SKELS')"
"LIBDEF ISPLLIB DATASET ID('SYS1.APPL01.LOAD')"
"SELECT CMD(APPL01" datasetname ") SCRNAME(APPL01)"
"LIBDEF ISPMLIB"
"LIBDEF ISPPLIB"
"LIBDEF ISPSLIB"
"LIBDEF ISPLLIB"
Address TSO
"ALTLIB DEACTIVATE APP(CLIST)"
End
Else Do
"ALTLIB ACTIVATE APP(CLIST) DSN('SYS1.APPL01.CLIST')"
Address ISPEXEC
"LIBDEF ISPMLIB DATASET ID('SYS1.APPL01.MSGS')"
"LIBDEF ISPPLIB DATASET ID('SYS1.APPL01.PANELS')"
"LIBDEF ISPSLIB DATASET ID('SYS1.APPL01.SKELS')"
"LIBDEF ISPLLIB DATASET ID
('SYS1.APPL01.LOAD')"
"SETMSG MSG(ISRZ001)"
"SELECT PANEL(PANEL01) NEWAPPL(ISR) PASSLIB SCRNAME(APPL01)"
"LIBDEF ISPMLIB"
"LIBDEF ISPPLIB"
"LIBDEF ISPSLIB"
"LIBDEF ISPLLIB"
Address TSO
"ALTLIB DEACTIVATE APP(CLIST)"
End
End
End
Return
/*===================================================================*/
Syntax:
Say "SYNTAX raised in line" sigl". rc="rc "("errortext(rc)")."
zsigl = sigl /* Number of sourceline in error */
Signal Common /* continue with common code */
NoValue:
Say "NOVALUE raised at line" sigl
zsigl = sigl /* Number of sourceline in error */
Parse Version impl langlevel . /* Look at language level */
If langlevel > 3.45 Then Do /* Condition BIF is supported */
Say "Then referenced variable is" "CONDITION"('D')
End
Signal Common /* continue with common code */
Common: /* Common error handling */
Trace 'o' /* Ensure no tracing */
If sourceline() <> 0 Then Do /* Source lines available */
Say '"'CompleteSource(zsigl)'"'/* Show the line in error */
End
If Left(impl,5) <> "REXXC" Then Do /* NOT running a compiled program*/
Say "You can look around now..." /* Tell user what they can do */
Trace ?R /* interactive tracing */
Nop
End
Exit
CompleteSource: Procedure
Parse Arg linenum
If Datatype(linenum) <> "NUM" Then linenum=1
line = Strip(SourceLine(linenum))
Do While (( Right(line,1) = ",") & (linenum <= SourceLine()))
linenum = linenum + 1
line = Left(line,(length(line)-1)) Strip(SourceLine(linenum))
End
Return line
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html