Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

terminate edit session and edit again

Status
Not open for further replies.

mikerexx

MIS
Aug 4, 2009
23
US
Can someone please help me with the following:

I am in an edit session on PDS(MEM)
I key my macro command - MAC1

MAC1 does
.
.
.
ADDRESS ISREDIT "SAVE"
ADDRESS ISREDIT "END"

ALLOC FI(F1) DA(PDS(MEM)
ALLOC FI...
"CALL *(PGM1)" /* this works fine */

Pgm1 will make changes to PDS(MEM)

I then want to do something like:
ADDRESS ISPEXEC "EDIT DATASET('PDS(MEM)')"

The problem is that at this point I get
**********************************************************
* ISRE093 *
* *
*Member in use *
* Member is being updated by you or another user. *


... the user is me.


I have tried many different scenarios:
FREE
LMCLOSE
etc
 

When PGM1 opens the data for output it gets an exclusive enqueue. You must release that enqueue. Unfortunately, the way ISPF sometimes manages enqueues you may be required to exit ISPF, not just EDIT, and not just your MACRO.


Frank Clarke
--America's source for adverse opinions since 1943.
 
OK. Forget about pgm1.

I want the macro to:
ISREDIT "END" to end my interactive edit session from which I initiated the macro.

Then I want the macro to:
ADDRESS ISPEXEC "EDIT DATASET('PDS(MEM)')" put me back in edit on the same pds member from which I started.

Can I not do this?
 
I'm confused.

You started your 'edit session' via
Code:
address ISPEXEC "EDIT ....  MACRO(MAC1)"
Right?

When MAC1 finishes it issues
Code:
address ISREDIT "END"
and control returns to the REXX exec. Then you
Code:
address TSO 
"ALLOC FI(TMP) DA(...) "
"CALL *(PGM1)"
"FREE  FI(TMP)"
and control again returns to the REXX exec. When you
Code:
address ISPEXEC "EDIT ....  MACRO(MAC2)"
it blows up.

Is that correct?


Frank Clarke
--America's source for adverse opinions since 1943.
 
I start out in an edit session in PDS(MEM). I get there by going to option 2 via the IPSF Primary Option Menu.

I then execute the macro by keying MAC1 on the command line.

The MAC1 macro will do:
ADDRESS ISREDIT "SAVE"
ADDRESS ISREDIT "END"

This will "END" the interactive edit session of the PDS member. The macro then does

ADDRESS ISPEXEC "EDIT DATASET('PDS(MEM)')"

This is when I get the error. So, I suspect that the enqueue that you mentioned yesterday remains even after the
ADDRESS ISREDIT "END" .

My thought is that upon the "END", a DEQ should be done to "free" the PDS(MEM) so that the "EDIT DATASET..." will work.



 
mikerexx said:
ADDRESS ISREDIT "END"

This will "END" the interactive edit session of the PDS member. The macro then does...

Whatever it does then is certainly 'undefined'. The MACRO environment is only valid within an EDIT session. When you end the EDIT session, you're done as far as any macro is concerned.

Now if you have an umbrella REXX exec which cranks EDIT and runs a MACRO (which does not "END", just 'return'), then you have the opportunity to do other things afterwards such as running a second macro.


Frank Clarke
--America's source for adverse opinions since 1943.
 
I thought the same thing at first. But I ran the macro anyway. It appears to be still alive after the "END".

But maybe since the "enq" is still active as you have indicated, the macro can still operate. In other words the "END" hasnt really completed and done a "deq" until the macro is finished. If this is true then I cannot have a macro do something to a pds member having initiated from that pds member.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top