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 

Macro not working second time

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


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Sat Jul 25, 2009 9:22 am    Post subject: Macro not working second time Reply with quote

HI,

I have written a macro which will be a replacement of comand REPL .ZF .ZL MEMNAME.It is working fine for first time i.e.Open the member in view mode and run the macro for first time it goes fine but when i run the same for second time without getting out of member, it is not working. Could any one tell me why it behaving like this.

Code:


/*REXX REXX REXX REXX REXX REXX REXX REXX REXX REXX REXX REXX REXX REX*/

ADDRESS ISPEXEC "ISREDIT MACRO (OPT) NOPROCESS"                         
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
                             
                                                                       
IF OPT = '?' THEN DO                                                   
  ZERRTP = 'CRITICAL'                                                   
  zerrlm   = ,                                                         
  left('22'x   "  comments       : save member in view mode       ",80),
  left('22'x   "  utility        : alternate rexx macro in place  ",80),
  left('22'x   "                 : of repl .zf .zl membername     ",80),
  left('22'x   "  help syntax    : vs ?                           ",80),
  left('22'x   "  normal syntax  : vs                             ",80),
  left('22'x   "  author         : siva kumar jetty fsams         ",80)
  zerrsm   = ""                                                         
  zerrhm   = "*"                                                       
  zerralrm = "no"                                                       
  "ISPEXEC SETMSG MSG(ISRZ003)"                                         
  exit                                                                 
END                                                                     

"ISREDIT (MEMB)=MEMBER"                                             
"ISREDIT (DS)=DATASET"                                             
"ISREDIT SAVE"                                                     
                                                                   
    IF RC/=0 THEN DO                                               
     ADDRESS ISREDIT  "ISREDIT REPL .ZF .ZL "MEMB""                 
         IF RC/=0 THEN DO                                           
           ADDRESS TSO "COMPRESS DA("DS")"                         
           ADDRESS ISREDIT "ISREDIT REPL .ZF .ZL "MEMB""           
           ZEDSMSG='trying to compress'                             
           "ISPEXEC SETMSG MSG (ISRZ000)"                           
         END                                                       
    END                                                             
                                                                   
    IF RC=0 THEN                                                   
       DO                                                           
        ZEDSMSG='SIVA 'MEMB' SAVED'                                 
        "ISPEXEC SETMSG MSG (ISRZ000)"   
    END                             
                           



Thanks,
Siva
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Jul 25, 2009 10:53 am    Post subject: Reply with quote

What does "not working?" and "behaving like this" mean? When asking for diagnosis of a problem, it is necessary to say more than "I have a problem, why?" what happens? Messages? Crashes? Codes? Trace data? ???

And I'll add that TSO COMPRESS is a local command so no one here will know how it works or what its side effects are.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Sat Jul 25, 2009 9:39 pm    Post subject: Reply with quote

semigeezer,

I meant my rexx code is executing for second time. Like if i open a member in view mode to make some changes to save the member , i exceute my rexx code. It's save for first time, but when i try to save more changes without getting out of that member. But it not saving for second time.

Thanks,
Siva
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Jul 26, 2009 8:31 am    Post subject: Reply with quote

Well, you could try turning Trace on and see what happens.

You could also put an EXIT statement at the end of the macro.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
arnold57
Beginner


Joined: 01 Oct 2004
Posts: 30
Topics: 0

PostPosted: Mon Jul 27, 2009 6:48 pm    Post subject: Reply with quote

Do you realize that since you used the NOPROCESS option, any changes you made on the screen will not be visible to the macro? That is, the data will be saved as it existed the last time you pressed Enter, not including any changes you made at the same time you entered your macro.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Aug 17, 2009 1:52 am    Post subject: Reply with quote

Your RC processing is not correct as far as I know.
You should do something like this:
"ISREDIT SAVE"
src = rc

Then you can ask what the status of the src is anywhere after that.
Back to top
View user's profile Send private message Visit poster's website
s_shivaraj
Beginner


Joined: 21 Sep 2004
Posts: 140
Topics: 14
Location: Chennai, India

PostPosted: Mon Aug 17, 2009 4:57 am    Post subject: Reply with quote

sivafdms,
I used the same piece of code, just deleted few lines. It worked for me. Didnt face any issue

Code:
/* REXX */                                                 
 ADDRESS ISPEXEC "ISREDIT MACRO (OPT) NOPROCESS"           
  "ISREDIT (MEMB)=MEMBER"                                   
  "ISREDIT (DS)=DATASET"                                   
  "ISREDIT SAVE"                                           
     IF RC/=0 THEN DO                                       
      ADDRESS ISREDIT  "ISREDIT REPL .ZF .ZL "MEMB""       
          IF RC/=0 THEN DO                                 
            ADDRESS TSO "COMPRESS DA("DS")"                 
            ADDRESS ISREDIT "ISREDIT REPL .ZF .ZL "MEMB""   
            ZEDSMSG='Compressing ......'                   
            "ISPEXEC SETMSG MSG (ISRZ000)"                 
          END                                               
     END                                                   
                                                           
        IF RC=0 THEN                                     
       DO                                           
        ZEDSMSG=       MEMB' Saved   '               
        "ISPEXEC SETMSG MSG (ISRZ000)"               
       END                                           
    Else                                             
       DO                                           
        ZEDSMSG=       MEMB' Save Failed'           
        "ISPEXEC SETMSG MSG (ISRZ000)"               
       END

_________________
Cheers
Sivaraj S

'Technical Skill is the Master of complexity, while Creativity is the Master of Simplicity'
Back to top
View user's profile Send private message AIM Address
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Mon Aug 17, 2009 8:15 am    Post subject: Reply with quote

I can see what you are doing, but if somebody tries to change your program that RC handling can easily get messed up. If I understand correctly you use the RC from two different sources, the RC from the save and the RC from the ISREDIT in your IF RC=0 THEN. Sure not easy to catch when you first fly over the routine.
Back to top
View user's profile Send private message Visit poster's website
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