MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RC 14 while using ISPEXEC EDIT DATASET ...

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
N.Haas
Beginner


Joined: 14 Aug 2009
Posts: 2
Topics: 1

PostPosted: Fri Aug 21, 2009 9:38 am    Post subject: RC 14 while using ISPEXEC EDIT DATASET ... Reply with quote

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. +++
                                                                               
     4 *-* "ISREDIT MACRO NOPROCESS"                                           
       >>>   "ISREDIT MACRO NOPROCESS"                                         
                                                                               
     6 *-* "ISREDIT (dsn) = DATASET"                            /**/           
       >>>   "ISREDIT (dsn) = DATASET"                                         
                                                                               
     7 *-* "ISREDIT (mem) = MEMBER"                      /**/                 
       >>>   "ISREDIT (mem) = MEMBER"                                         
                                                                               
     8 *-* IF mem = ''                                                         
       >>>   "0"                                                               
                                                                               
    10 *-* ELSE                                                               
    11 *-*  data_set = "'"dsn"("mem")'"                                       
       >>>    "'V594226.SA1#.EXEC(QUEST)'"                                     
                                                                               
    13 *-* /**/                                                               
    15 *-* "ISREDIT (session) = SESSION"                 /**/                 
       >>>   "ISREDIT (session) = SESSION"                                     
                                                                               
    16 *-* IF session = "EDIT"                                                 
       >>>   "1"                                                               
                                                                               
       *-*  THEN                                                               
       *-*  "ISREDIT SAVE"          /**/                                       
       >>>    "ISREDIT SAVE"                                                   
                                                                               
    17 *-* "ISREDIT CANCEL"                     /**/                           
       >>>   "ISREDIT CANCEL"                                                 
                                                                               
    19 *-* "ISPEXEC CONTROL ERRORS RETURN"                      /**/           
       >>>   "ISPEXEC CONTROL ERRORS RETURN"                                   
                                                                               
    20 *-* "ISPEXEC EDIT DATASET("data_set") MACRO(ANYMACRO)" /**/             
       >>>   "ISPEXEC EDIT DATASET('V594226.SA1#.EXEC(QUEST)') MACRO(ANYMACRO)"
       +++ RC(14) +++                                                         
                                                                               
    21 *-* SAY rc"," zerrlm
>>>   "14, Member is being updated by you or another user. Enter HELP for a list of us
ers using the data set.                                                       
                                                                               
    26 *-* EXIT                                                               
***                                                                           


Any ideas?

Thanks, Best regards, Norbert
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Aug 21, 2009 10:23 am    Post subject: Reply with quote

based on experience (and testing):
even though your 'macro' said cancel the current edit session is open until your macro executes an 'exit'.

an edit macro can only run in an edit/view session.
can't run in pure ispf (e.g. pds member list)

why do you want to 're-edit' the ds that you were editing?

a simple invoke (call) of the anymacro macro would accomplish your desires.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
N.Haas
Beginner


Joined: 14 Aug 2009
Posts: 2
Topics: 1

PostPosted: Wed Aug 26, 2009 1:45 am    Post subject: Reply with quote

Hi Dick,

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?

Thanks, Best Regards (Norbert, also GERMANY)
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Aug 26, 2009 3:23 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group