View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Sat Jul 25, 2009 9:22 am Post subject: Macro not working second time |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sat Jul 25, 2009 10:53 am Post subject: |
|
|
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 |
|
 |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Sat Jul 25, 2009 9:39 pm Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sun Jul 26, 2009 8:31 am Post subject: |
|
|
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 |
|
 |
arnold57 Beginner
Joined: 01 Oct 2004 Posts: 30 Topics: 0
|
Posted: Mon Jul 27, 2009 6:48 pm Post subject: |
|
|
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 |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Mon Aug 17, 2009 1:52 am Post subject: |
|
|
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 |
|
 |
s_shivaraj Beginner

Joined: 21 Sep 2004 Posts: 140 Topics: 14 Location: Chennai, India
|
Posted: Mon Aug 17, 2009 4:57 am Post subject: |
|
|
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 |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Mon Aug 17, 2009 8:15 am Post subject: |
|
|
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 |
|
 |
|
|