Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISPF EDIT Macro

Status
Not open for further replies.

skaturi

Programmer
May 26, 2009
4
US
Hi,

I wrote a isredit macro which will be called from one of my Rexx exec. This rexx will open a member in pds and execute a macro. The macro should find a string and get back me the string and next 12 charcters.

The problem is that my macro is not executing with the following command. It opens the dataset in ISPF panel and stops there.

ADDRESS ISPEXEC "EDIT DATASET('"MEMDD"') MACRO(STRMACRO)" where MEMDD is variable with pds(member).

I had both the rexx program and macro in the same pds. the macro is below
/*REXX*/
ADDRESS ISREDIT "MACRO(STRMACRO)"
TRACE('?I')
MEMBR = "GXYZ0016"
SRCHSTR=MEMBR||20
ADDRESS ISREDIT "F" SRCHSTR
ADDRESS ISREDIT "(LNNUM) = LINENUM"
ADDRESS ISREDIT "(LNVAR) = LINE LNNUM"
ADDRESS TSO
STRPOS=POS(SRCHSTR,LNVAR)
IF STRPOS > 0 THEN DO
STRPOS=STRPOS+ LENGTH(MEMBR)
NEWSTR=SUBSTR(LNVAR,STRPOS,14)
SAY STRPOS
SAY NEWSTR
END
ADDRESS ISREDIT "CANCEL"
Exit

Require some help on this.Please
 

When you are in "interactive trace" ("?") you must press ENTER after every statement. You're not just waiting for something to happen, are you?


Frank Clarke
--America's source for adverse opinions since 1943.
 
Yes, we need to press enter after every statement. I used that to see what was happening after myy macro open the required dataset. There is no need for that trace but just for debug.
 

Then the only thing I can think of is that your opening statement
Code:
ADDRESS ISREDIT "MACRO(STRMACRO)"
seems odd. I would make it
Code:
ADDRESS ISREDIT "MACRO"
but I'm guessing.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Hi Frank,

Thanks for the resposne. I changed that to

ADDRESS ISREDIT "MACRO"

Still the macro doesn't run. The rexx just opens the member in the pds in ispf screen and stays there.

Thanks,
 
Works for me...
Code:
        >>>   "N"
      3 *-* memdd = "****.****.cntl(@@jtst)"
        >>>   "****.****.cntl(@@jtst)"
      4 *-* ADDRESS ISPEXEC "EDIT DATASET('"MEMDD"') MACRO(STRMACRO)"
        >>>   "EDIT DATASET('****.****.cntl(@@jtst)') MACRO(STRMACRO)"
      4 *-* MEMBR = "GXYZ0016"
        >>>   "GXYZ0016"
 IRX0100I +++ Interactive trace.  TRACE OFF to end debug, ENTER to continue. +++

      5 *-* SRCHSTR=MEMBR||20
        >>>   "GXYZ001620"

      6 *-* ADDRESS ISREDIT "F" SRCHSTR
        >>>   "F GXYZ001620"
        +++ RC(4) +++

      7 *-* ADDRESS ISREDIT "(LNNUM) = LINENUM"
        >>>   "(LNNUM) = LINENUM"
 ***

Of course, I don't know what it's supposed to do and the dataset is probably configured wrong, but I did get something out of it...


Frank Clarke
--America's source for adverse opinions since 1943.
 

Just curious...

What is this
Code:
SRCHSTR=MEMBR||20
supposed to do? I'd be surprised if it's doing what you wanted it to do.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Hi Frank,

The purpose this code is to get the timestamp from the laod module. The timestamp in the load module wil;l be be present after moadule name and timestamp will be in format of YYYYMMDDHHMMSS.Most of the modules have compiled after 20000101,hence i am using member||20 so that the search string will be unique.

May be some thing to do with record format. all load libraries will have VB.

I think i need to use LMINIT instead of isrredit.

Thanks,
 

All load libraries will be RECFM=U. You are correct that you will not be able to ISREDIT them.


Frank Clarke
--America's source for adverse opinions since 1943.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top