Hi all,
this is my first post and I am quite new to the mainframe world and try hard to learn and understand. If this questions shows a general lack of knowledge, please correct me in a usefull manner.
So here it goes:
I need to write an EditMacro which closes the Member (or PS-Dataset) from which the macro was opened, perform some actions and in the end it shall open the member it closed in the beginning.
Here is what I tried in REXX:
/* REXX */
.
.
"ISREDIT MACRO NOPROCESS"
"ISPEXEC CONTROL ERRORS RETURN"
"ISREDIT (dsn) = DATASET"
"ISREDIT (mem) = MEMBER"
IF mem /= "" THEN
dsn = "'" !! dsn!!"("!!mem!!")" !! "'"
"ISREDIT SAVE"
"ISREDIT BUILTIN END"
/* Actions to perform against the member, doesn't matter which actions */
"ISPEXEC EDIT DATASET ("dsn")"
EXIT
The Problem is that the ISPEXEC EDIT DATASET returns with RC14. Member in use. The Member is in use by myself. So the ISREDIT END command did'nt close the member completly.
I tried to free the dataset, but this did not work either.
I tried to run two edit macros. One which runs the "ISREDIT END" and after ends with an EXIT. I hoped the the EXIT would free the member.
In and act of desperation I played with LMCLOSE. Without any success
I found out that the two macros work fine, if I call them from the command line as seperate commands
EDIT Macro 1 (which closes the member and ends with an EXIT) (then the command seperator) and "TSO EDIT MACRO 2" (which opens the member)
Anyhow, if I write a third edit macro which which runs the two mentioned above as "ADDRESS TSO MACRO1" and "ADDRESS TSO MACRO 2" I receive RC14 for the "ISPEXEC EDIT DATASET" again.
So it must have something to do with the fact, that the macros runs.
I hope my problem is clear (lots of text, sorry for that, but I wanted you guys to know what I allready tried)
Do you have any further idea how to close a member and open it again?
Thanks so much in advance