Running TSO in batch and capturing SYSTSPRT 
Author Message
 Running TSO in batch and capturing SYSTSPRT

The title says it all.  I need to capture the SYSTSPRT output of a few TSO
commands that I execute in a started task, writing in an authorized
assembler environment.

There is no performance issue, so I started with what I thought was the most
straightforward and cleanest approach, namely to dynamically allocate
SYSTSIN and SYSTSPRT, fill up SYSTSIN with the commands, and then attach the
TMP with JSTCB=YES.  But the "TSO/E Customization" manual warns in an
Appendix about using the TMP.  And sure enough, if I do this twice in the
same job, the second attempt blows up with ABEND047.  (I now hate the TMP.)

So I tried using the IKJEFTSR service, with or without IKJTSOEV, IKJEFTSI,
and IKJEFTST, but the SYSTSPRT file would never get closed, even if I ran
the services in a subtask with JSTCB=YES.  I tried using only IKJTSOEV and
attaching the commands directly, without using any IKJEFTxx services, but to
no avail.

Does anyone know how to shut down a TSO/E environment created by IKJTSOEV or
IKJEFTSI, at least enough so that it closes SYSTSPRT?  You would think that
IKJEFTST would completely clean up the IKJEFTSI environment, but apparently
not.



Sat, 16 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT

Quote:

>The title says it all.  I need to capture the SYSTSPRT output of a few TSO
>commands that I execute in a started task, writing in an authorized
>assembler environment.

>There is no performance issue, so I started with what I thought was the most
>straightforward and cleanest approach, namely to dynamically allocate
>SYSTSIN and SYSTSPRT, fill up SYSTSIN with the commands, and then attach the
>TMP with JSTCB=YES.  But the "TSO/E Customization" manual warns in an
>Appendix about using the TMP.  And sure enough, if I do this twice in the
>same job, the second attempt blows up with ABEND047.  (I now hate the TMP.)

>So I tried using the IKJEFTSR service, with or without IKJTSOEV, IKJEFTSI,
>and IKJEFTST, but the SYSTSPRT file would never get closed, even if I ran
>the services in a subtask with JSTCB=YES.  I tried using only IKJTSOEV and
>attaching the commands directly, without using any IKJEFTxx services, but to
>no avail.

>Does anyone know how to shut down a TSO/E environment created by IKJTSOEV or
>IKJEFTSI, at least enough so that it closes SYSTSPRT?  You would think that
>IKJEFTST would completely clean up the IKJEFTSI environment, but apparently
>not.

A couple of ideas come to mind.

First, when you allocate SYSTSPRT include the option SPIN(UNALLOC). Then, when
you do this work as a subtask, after the subtask completes issue a FREE
command. This might do the trick.

Alternatively, how about coding a REXX exec that turns on output trapping,
issues your command(s), and turns off output trapping. Now you have your output
lines in an array of REXX variables; these can be parsed, processed, or output
to a file (not SYSTSPRT). Then you're off and running. Run the exec from the
TMP (EXEC PGM=IKJEFT01,PARM='exec exec_name exec').

Hope this helps. Good luck.

Steve Comstock
Telephone: 303-393-8716
www.trainersfriend.com

256-B S. Monaco Parkway
Denver, CO 80224
USA



Sat, 16 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT

Quote:

> There is no performance issue, so I started with what I thought was the most
> straightforward and cleanest approach, namely to dynamically allocate
> SYSTSIN and SYSTSPRT, fill up SYSTSIN with the commands, and then attach the
> TMP with JSTCB=YES.  But the "TSO/E Customization" manual warns in an
> Appendix about using the TMP.  And sure enough, if I do this twice in the
> same job, the second attempt blows up with ABEND047.  (I now hate the TMP.)

The TMP must run authorized, but will turn off job-step authorization as part of
its operation. You must go into key zero or supervisor state before you attach
the TMP and restore any required authorization once it completes. You should
also be using RSAPF=YES on the ATTACH.

--

Shmuel (Seymour J.) Metz
Reply to host nsf (dot) gov, user smetz



Sat, 16 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT

:>The title says it all.  I need to capture the SYSTSPRT output of a few TSO
:>commands that I execute in a started task, writing in an authorized
:>assembler environment.

/*  REXX */
"SPECCMD INIT"
Do  While  RC = 0
    z = OUTTRAP("OUTPUT.")
    NEXTCMD
    SAVERC = RC
    z = OUTTRAP("OFF")
    "SPECCMD"
End

Where SPECCMD:

1. Puts the OUTPUT. and RC in some storage area
2. Wait for the next command or stop
3. Sets NEXTCMD to the next command to issue    

   [ snipped ]

--


Director, Dissen Software, Bar & Grill - Israel



Sat, 16 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT
Shmuel,

Thanks for the response.  I did in fact use RSAPF=YES, and got ABEND047 when
I tried the TMP a second time.  Why would the TMP cause me to lose
APF-authorization in my own JSTCB when it (the TMP) had been running under
its *own* JSTCB?  This is pretty nefarious.

If running the TMP is simply a matter of restoring APF-auth afterwards (with
a magic SVC), then maybe I'll try it again.  In fact, if I attach a new
JSTCB which itself attaches the TMP under a third JSTCB, will the TMP reset
APF-auth on *all* JSCTB's?  I'll have to try it out.

IBM has made *some* effort to allow us to invoke TSO commands in batch by
providing us with IKJTSOEV, IKJEFTSR, etc.  Why would they not also provide
an easy way to capture SYSTSPRT?

...Ed

Quote:

>The TMP must run authorized, but will turn off job-step authorization as
part of
>its operation. You must go into key zero or supervisor state before you
attach
>the TMP and restore any required authorization once it completes. You
should
>also be using RSAPF=YES on the ATTACH.



Sat, 23 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT
Steve,

Thanks for the SPIN(UNALLOC) idea.  I will definitely try it out.

...Ed

Quote:

>First, when you allocate SYSTSPRT include the option SPIN(UNALLOC). Then,
when
>you do this work as a subtask, after the subtask completes issue a FREE
>command. This might do the trick.



Sat, 23 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT
Binyamin,

Thanks for the REXX idea.  REXX saves the day again.

...Ed

Quote:

>/*  REXX */
>"SPECCMD INIT"
>Do  While  RC = 0
>    z = OUTTRAP("OUTPUT.")
>    NEXTCMD
>    SAVERC = RC
>    z = OUTTRAP("OFF")
>    "SPECCMD"
>End

>Where SPECCMD:

>1. Puts the OUTPUT. and RC in some storage area
>2. Wait for the next command or stop
>3. Sets NEXTCMD to the next command to issue



Sat, 23 Jun 2001 03:00:00 GMT  
 Running TSO in batch and capturing SYSTSPRT

Quote:

> Shmuel,

> Thanks for the response.  I did in fact use RSAPF=YES, and got ABEND047 when
> I tried the TMP a second time.  Why would the TMP cause me to lose
> APF-authorization in my own JSTCB when it (the TMP) had been running under
> its *own* JSTCB?  

Because it still has the same JSCB.

--

Shmuel (Seymour J.) Metz
Reply to host nsf (dot) gov, user smetz



Tue, 26 Jun 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. TSO-REXX: Edit Macros in Batch Mode

2. Xpediter/TSO versus Intertest/Batch

3. How to allocate and delete files when NOT running under TSO

4. Running APL in a batch program

5. Running Batch Jobs !!

6. Can CW be run in a batch or perhaps automation

7. V4: How do I run batches?

8. Running a WHOIS command in Batch

9. REXX for Windows -- running a batch program

10. running REXX in batch

11. (Q) run batch job on scm???

12. Running a msdos batch program

 

 
Powered by phpBB® Forum Software