Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TSO-REXX: Edit Macros in Batch Mode

770 views
Skip to first unread message

Jim French

unread,
Feb 25, 1998, 3:00:00 AM2/25/98
to

I'm trying to invoke an ISPF edit macro in batch mode. My reference
manual says that in order to use ISREDIT "you must be in an edit
session." Question: Is there a way to create an ISPF edit session in
batch mode so that an ISREDIT macro can run in it?

Thanks,

Jim

Bill Lynch

unread,
Feb 25, 1998, 3:00:00 AM2/25/98
to

Jim French wrote:

I think you're out of luck here. ISREDIT requires ISPF, and ISPF (AFAIK)
doesn't run in batch. Please let us know if you find a solution to this,
I've wanted to do this a few times.

HTH,
Bill Lynch

Doug Nadel

unread,
Feb 26, 1998, 3:00:00 AM2/26/98
to

Jim,
Just create a batch job with the ISPF libraries allocated (ISPxLIB et
al) and a call to IKJEFT01 (the TSO TMP). Then in the systsin dd
statement, use
ISPSTART CMD(some exec) NEWAPPL(ISR)
and have the 'some exec'
do an ISPEXEC EDIT DATASET(some dataset) MACRO(some macro)

ISPF supplies an exec ISREPDF that can be used for this (or from TSO
READY or from an ISPF Command line) so I guess you could use
ISPSTART CMD(ISREPDF somedataset MACRO(somemacro) NEWAPPL(ISR)
in the JCL
-Doug

Jim Van Sickle

unread,
Feb 26, 1998, 3:00:00 AM2/26/98
to Jim French

Bill Lynch wrote:
>
> Jim French wrote:
>
> > I'm trying to invoke an ISPF edit macro in batch mode. My reference
> > manual says that in order to use ISREDIT "you must be in an edit
> > session." Question: Is there a way to create an ISPF edit session in
> > batch mode so that an ISREDIT macro can run in it?
> >
> > Thanks,
> >
> > Jim
>
> I think you're out of luck here. ISREDIT requires ISPF, and ISPF (AFAIK)
> doesn't run in batch. Please let us know if you find a solution to this,
> I've wanted to do this a few times.
>
> HTH,
> Bill Lynch

You absolutely can run ISPF in batch!

For example, you can use PGM=IKJEFT01 with PARM='ISPSTART CMD(MYEDITOR)'

Create a clist or REXX exec called MYEDITOR (or whatever), and make sure it's in
a library that's in your JCL SYSPROC DD concatenation. MYEDITOR would look
something like this:

/* REXX - MYEDITOR */
"ISPEXEC CONTROL ERRORS RETURN"
"ISPEXEC EDIT DATASET(your_dataset) MACRO(your_edit_macro)"
exit

Only catch is that you need to make sure all the proper DD's are in your JCL,
including panels (ISPPLIB), messages (ISPMLIB), etc.

Good Luck :-)
--

***********************************************
* Jim Van Sickle <mailto:jim...@ibm.net> *
* Manager, Operations and Tech Support *
* United Retail, Inc. *
*---------------------------------------------*
* visit my meager web site at: *
* <http://mypage.ihost.com/jimswebsite/> *
***********************************************

Roy Gardiner

unread,
Feb 26, 1998, 3:00:00 AM2/26/98
to

Doug Nadel wrote:
>
> Jim,
> Just create a batch job with the ISPF libraries allocated (ISPxLIB et
> al) and a call to IKJEFT01 (the TSO TMP). Then in the systsin dd
> statement, use
> ISPSTART CMD(some exec) NEWAPPL(ISR)
> and have the 'some exec'
> do an ISPEXEC EDIT DATASET(some dataset) MACRO(some macro)
>

Absolutely right, of course.

There's lots to watch out for running ISPF in batch.

Where will you get the ISP and ISR profiles from? If you use the system
standard, it is possible that two people can run your macro at the same
time and get contention

Will your routine do any file tailoring (or indeed anything clever)? If
so, make sure that you allocate ISPF work files, or it will try and use
the same ones as the on-line user - contention again.

Are you going to use your own profile variables in the macro? My advice
is DON'T, because you can never guarantee that what's in batch is the
same as what's on-line to you (you can't use your own profile libraries
direct in batch, contention yet again).

I think I have made all the idiot mistakes possible in running batch
ISPF because I've done a LOT of it. Would anyone be interested in a more
comprehensive guide and some free sample code?

Roy Gardiner

Bill Lynch

unread,
Feb 26, 1998, 3:00:00 AM2/26/98
to

Roy Gardiner wrote:

> Doug Nadel wrote:
> >
> > Jim,
> > Just create a batch job with the ISPF libraries allocated (ISPxLIB et
> > al) and a call to IKJEFT01 (the TSO TMP). Then in the systsin dd
> > statement, use
> > ISPSTART CMD(some exec) NEWAPPL(ISR)
> > and have the 'some exec'
> > do an ISPEXEC EDIT DATASET(some dataset) MACRO(some macro)
> >

(snip)

> I think I have made all the idiot mistakes possible in running batch
> ISPF because I've done a LOT of it. Would anyone be interested in a more
> comprehensive guide and some free sample code?
>

You bet, sign me up!

TIA,
Bill Lynch


> Roy Gardiner


Frank Clarke

unread,
Feb 27, 1998, 3:00:00 AM2/27/98
to

Roy Gardiner <gard...@btinternet.com> wrote:

>Where will you get the ISP and ISR profiles from? If you use the system
>standard, it is possible that two people can run your macro at the same

>time and get contention.

I always build an empty ISPPROF, DISP=NEW and take the defaults. And
I build them in VIO so they evaporate at jobend: no DSN, no CATLG, no
nuthin'.

Frank Clarke
Tampa Area REXX Programmers' Alliance
Member of the REXX Language Association
Join us at http://www.rexxla.org
(Remove the currency symbol before replying.)

Roy Gardiner

unread,
Mar 1, 1998, 3:00:00 AM3/1/98
to

Frank Clarke wrote:
>
> Roy Gardiner <gard...@btinternet.com> wrote:
(snip my stuff)

> I always build an empty ISPPROF, DISP=NEW and take the defaults. And
> I build them in VIO so they evaporate at jobend: no DSN, no CATLG, no
> nuthin'.

Frank,

I get RC 12s when doing it your way. I have always presumed this was
because the tables are open WRITE during the build and that two batch
jobs running together would contend. It happened to me whenever I used
something automated to submit several jobs (with different job names)
and several initiators were available. Of course, it only happens some
of the time.

Are the RC 12s due to something else?

What I do now is to IEBCOPY the tables to a temporary and open them in
the ISPF step. This always works, but is of course an overhead.

I have summarised my experiences with ISPF in BATCH at my web site


Roy Gardiner

http://www.xasys.com

Warning! Advertising!

Frank Clarke

unread,
Mar 2, 1998, 3:00:00 AM3/2/98
to

Roy Gardiner <gard...@btinternet.com> wrote:
>
>I get RC 12s when doing it your way. I have always presumed this was
>because the tables are open WRITE during the build and that two batch
>jobs running together would contend. It happened to me whenever I used
>something automated to submit several jobs (with different job names)
>and several initiators were available. Of course, it only happens some
>of the time.
>
>Are the RC 12s due to something else?

//ISPPROF DD UNIT=VIO,DISP=(NEW,DELETE),
// SPACE=(TRK,(10,10,40)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)

It's not possible this could cause contention, not even with a
following step, certainly not with a sister-job. The RC=12 must be
from something else.

I have seen the occasional "TBOPEN FAILED -- TABLE IN USE" and have
been unable to diagnose it. Dataset-conflict seems the most unlikely
culprit.

Roy Gardiner

unread,
Mar 2, 1998, 3:00:00 AM3/2/98
to ni...@mindspring.com

Frank Clarke wrote:

> Roy Gardiner <gard...@btinternet.com> wrote:

> >I get RC 12s when doing it your way. I have always presumed this was
> >because the tables are open WRITE during the build and that two batch
> >jobs running together would contend. It happened to me whenever I used
> >something automated to submit several jobs (with different job names)
> >and several initiators were available. Of course, it only happens some
> >of the time.
> >
> >Are the RC 12s due to something else?
>
> //ISPPROF DD UNIT=VIO,DISP=(NEW,DELETE),
> // SPACE=(TRK,(10,10,40)),
> // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
>
> It's not possible this could cause contention, not even with a
> following step, certainly not with a sister-job. The RC=12 must be
> from something else.

I obviously explained it badly; I don't believe it's the ISPPROF dataset
that causes the problem or any dataset contention.



> I have seen the occasional "TBOPEN FAILED -- TABLE IN USE" and have

exactly!

> been unable to diagnose it. Dataset-conflict seems the most unlikely
> culprit.


What I think happens is that ISPF opens the tables in WRITE mode and
then TBSAVES them to the ISPPROF dataset. It is this that causes the
RC12 TABLE IN USE message. As you know, if you TBOPEN a table in WRITE
mode then no-one else can as well. Anyway, our joint experience is of
(rare) failure.

IEBCOPY of the system tables to a temporary dataset, defined as ISPTLIB
to batch TSO, eliminates the problem. More info. at my web site (below).
--

Mickey Ben-Tovim

unread,
Mar 2, 1998, 3:00:00 AM3/2/98
to

Thank God this is NOT true. I make my living running batch edit macros.
The trick is to start an IKJEFT01 session and pass the name of a REXX
that will start ISPF on the SYSTSIN card. I have a series of REXX
programs that do just this. I will not post them here as there are not
small. For all who would like them, send me an e-mail stating such with
your return address and i'll be happy to send them your way.

Mickey
mic...@home.com

0 new messages