Posted: Fri Aug 21, 2009 9:38 am Post subject: RC 14 while using ISPEXEC EDIT DATASET ...
Hi, who can help me with the following problem?
This test macro reads the data set and the member name, concats
both parts together, saves the data set (if EDIT and not VIEW),
leaves the editor and tries to re-edit the same data set again.
I always receive RC = 14 (Data set in use), evan if CANCEL should
have left the editor.
Code:
***************************** Top of Data ******************************
/* REXX ------------------------------------------------------------- */
Trace ?r; NOP
"ISREDIT MACRO NOPROCESS"
"ISREDIT (dsn) = DATASET" /* Data set name */
"ISREDIT (mem) = MEMBER" /* Member name (if any) */
IF mem = '' THEN
data_set = "'"dsn"'"
ELSE
data_set = "'"dsn"("mem")'"
/* Other code ... what ever ... */
"ISREDIT (session) = SESSION" /* Returns EDIT or VIEW */
IF session = "EDIT" THEN "ISREDIT SAVE" /* Save data if EDIT */
"ISREDIT CANCEL" /* Cancel (and leave) the editor */
"ISPEXEC CONTROL ERRORS RETURN" /* Return rc > 8 */
"ISPEXEC EDIT DATASET("data_set") MACRO(ANYMACRO)" /* Trie to re-edit */
SAY rc"," zerrlm
/* 14, Member is being updated by you or another user. Enter HELP for */
/* a list of users using the data set. */
EXIT
**************************** Bottom of Data ****************************
And tha's the way the TRACE output looks like:
Code:
3 *-* NOP
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
first, you're absolutely right with that answert "based on experience...". I found out, the the ISREMSPY still shows the editor evan if it's called after ther "ISREDIT CANCEL" line. So, yes the editor is still workin until the macro statement EXIT will be done.
The little comment line /* Other code ... what ever ... */ is very important for my example. These lines create other important stuff for the macro ANYMACRO, which can not be done in another way then leaviving the editor and re-edit again.
Do you know any other way to end the macro (EXIT) and open the editor again anyhow?
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Wed Aug 26, 2009 3:23 am Post subject:
as I said, after the SAVE (if you are in edit mode),
just CALL ANYMACRO from your primary edit macro. _________________ Dick Brenholtz
American living in Varel, Germany
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum