View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Thu May 07, 2009 5:38 am Post subject: link two macro's |
|
|
Hi All,
i have written two edit macro's
First macro
Code: |
/* REXX */
"ISREDIT MACRO (MORE)"
/* TRACE I */
UPPER MORE
CC = 0
'ISREDIT F "DATE-COMPILED" FIRST'
SAY "ZERRSM : " ZERRSM
SAY "ZERRLM : " ZERRLM
IF CC = 0 THEN DO
'ISREDIT (R1,C1) = CURSOR'
'ISREDIT LABEL &R1 = .LA'
'ISREDIT (LN2) = LINE .LA'
LN =' DATE-WRITTEN. MAY 2009. '
'ISREDIT LINE_BEFORE &R1 = (LN)'
END
|
Second macro
Code: |
/************************ REXX ********************************/
/* EDIT ALL MEMBERS OF THE CURRENTLY ALLOCATED PDS EXCEPT THE */
/* MEMBER BEING EDITED. PASS NAME OF EDIT MACRO AS ONLY PARM. */
/**************************************************************/
TRACE I
"ISREDIT MACRO (EDITMAC)"
/* IDENTIFY CURRENTLY OPEN PDS */
"ISREDIT (OPENPDS) = DATAID"
/* IDENTIFY CURRENTLY OPEN MEMBER */
"ISREDIT (OPENMBR) = MEMBER"
/* OPEN PDS FOR INPUT */
ADDRESS ISPEXEC
"LMOPEN DATAID("OPENPDS") OPTION(INPUT)"
MBR = ' '
SAVERC = 0
DO WHILE SAVERC = 0
"LMMLIST DATAID("OPENPDS") MEMBER(MBR) OPTION(LIST) STATS(NO)"
SAVERC = RC
IF (SAVERC = 0) & (MBR \= OPENMBR) THEN DO
"EDIT DATAID("OPENPDS") MEMBER("MBR") MACRO("EDITMAC")"
END
END
/* FREE AND CLOSE PDS */
"LMMLIST DATAID("OPENPDS") OPTION(FREE)"
"LMCLOSE DATAID("OPENPDS")"
END
EXIT
|
i want to link these two marco such that when i open pds and execucte the second macro it should call first macro. this way it should run for all the members in the pds
Thanks,
Siva |
|
Back to top |
|
 |
prino Banned
Joined: 01 Feb 2007 Posts: 45 Topics: 5 Location: Oostende
|
Posted: Thu May 07, 2009 6:05 am Post subject: |
|
|
You have written two macros?
The first one looks very suspiciously like the 'ISRMBRS' in the 'ISPF Edit and Edit Macros' manual. Maybe read that manual again to see how they interact with each other. |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu May 07, 2009 2:33 pm Post subject: |
|
|
Actually, it isn't ISRMBRS but it did appear on another bbs posted as: Posted: Mon Nov 20, 2006 7:24 pm Post subject: Add Comments in all the members of PDS using REXX _________________ 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: Thu May 07, 2009 7:50 pm Post subject: |
|
|
prino,
I have written the first macro but to edit the all members at a time i used the code from that post.. i have read manual but i could not able to figure out how to link them.Please could you help me if you know.
Thanks,
Siva |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri May 08, 2009 3:35 pm Post subject: |
|
|
simply invoke the 2nd one with the name of the 1st one as a parameter. Note that the 1st one has a parameter (MORE) that is not used so it is not a problem but if you do need to use a parameter on the 1st one, there is more code required in both routines.
The reason you invoke the 2nd one with the name of the 1st one is that the 2nd takes the name as a parameter (EDITMAC) and then invokes the editor recursively using that name as a macro name Code: | "EDIT DATAID("OPENPDS") MEMBER("MBR") MACRO("EDITMAC")" |
You will probably want to add an ISREDIT END to the 1st one unless you need to review the changes it makes.
There are some programming errors in the 1st one too. CC is not a built in rexx variable (you want RC) and it is being set before the FIND command so you will always fall through to the next step. also &R1 is CLIST syntax so you probably want to take R1 out of the quotes so it is resolved by Rexx. (*) I haven't really looked at it in any more detail.
(*) ISPEXEC can resolve & variables. I don't know if ISREDIT does. It might. _________________ 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 |
|
 |
|
|