Dear Masters of MVS IMACROS,
We are running z/OS V1R13 and I have coded two macros from the ISPF Edit and
Edit Macros book.
I created ISRIMBED:
ADDRESS ISPEXEC
"ISREDIT MACRO (MEMBER)" /* Member name passed */
/* as input */
"ISREDIT LINE_AFTER .ZL='MEMBER &MEMBER'" /* Add member ID line */
"ISREDIT (LINENBR) = LINENUM .ZL" /* Get line number */
"ISREDIT COPY AFTER .ZL" MEMBER /* Copy member at end */
"ISREDIT (NEWLL) = LINENUM .ZL" /* Get new last line# */
IF LINENBR = NEWLL THEN /* If no data was */
EXIT 8 /* copied, then exit */
ELSE DO
NEWNBR = LINENBR + 1
"ISREDIT LABEL" NEWNBR " = .FIRST" /* Label first */
/* line copied */
"ISREDIT RESET EXCLUDED" /* Make sure there are */
/* no previously */
/* excluded lines */
"ISREDIT EXCLUDE ALL .FIRST .ZL" /* Exclude newly */
/* copied lines */
"ISREDIT FIND ALL .IM 1 .FIRST .ZL" /* Show lines */
FINDRC = LASTCC /* containing ".im" */
/* in column 1 */
"ISREDIT DELETE ALL X .FIRST .ZL" /* Delete any lines */
/* still excluded */
"ISREDIT (NEWLL) = LINENUM .ZL" /* Update last line */
/* number after delete */
IF FINDRC = 0 THEN /* If ".im" was found */
DO WHILE (LINENBR < NEWLL) /* for all remaining */
/* copied lines */
LINENBR = LINENBR + 1 /* Shift all .im */
"ISREDIT SHIFT" LINENBR ") 8" /* lines right 8 */
END
END
EXIT 1 /* Place cursor on */
/* command line */
ISRIMBED reads LIST:
.im imbedname1
**************
.im imbedname2
**************
.im imbedname3
This works great!
I also created ISRMBRS:
'ISREDIT MACRO (NESTMAC)'
/*********************************************************************/
/* Get dataid for data set and issue LMOPEN */
/*********************************************************************/
'ISREDIT (DATA1) = DATAID'
'ISREDIT (CURMEM) = MEMBER'
Address ispexec 'LMOPEN DATAID('data1') OPTION(INPUT)'
member = ' '
lmrc = 0
/*********************************************************************/
/* Loop through all members in the PDS, issuing the EDIT service for */
/* each. The macro specified on the ALLMEMS invocation is passed as */
/* an initial macro on the EDIT service call. */
/*********************************************************************/
Do While lmrc = 0
Address ispexec 'LMMLIST DATAID('data1') OPTION(LIST),
MEMBER(MEMBER) STATS(NO)'
lmrc = rc
If lmrc = 0 & member = curmem Then
do
Say 'Processing member' member
Address ispexec 'EDIT DATAID('data1') MEMBER('member')
MACRO('nestmac')'
end
End
/*********************************************************************/
/* Free the member list and close the dataid for the PDS. */
/*********************************************************************/
Address ispexec 'LMMLIST DATAID('data1') OPTION(FREE)'
Address ispexec 'LMCLOSE DATAID('data1')'
Exit 0
From a test library (PMSBDH.IMACRO.TEST), not in my concatenation I EDIT a
member named "TEST" and key "ISRMBRS ISRIMBED". This keeps failing saying the
member is in use. I did an ALTLIB Add to concatenate my PMSBDH.IMACRO Library.
It says PMSBDH.IMACRO.TEST(TEST) is in use by PMSBDH (me). If I look at the
message ISRE093 it says "Or release the member from another logical screen". I
keep logging off and back on. But this does not resolve the issue. The MACRO
appears to be running as designed. I pass ISRIMBED to ISRMBRS. I get the
dataid for the data set and issue the LMOPEN. My last instruction is "EDIT
DATAID(ISR00001) MEMBER(TEST ) MACRO(isrimbed)".
Q). What am I missing? The only thing I saw in tracing was the MEMBER name
had blanks at the end in the EDIT DATAID Call. How did I get a lock on my own
"TEST" member?
Thanks again, Dave
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN