Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Not able to execute the ISREDIT MACRO, getting RC 20

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
asarolia

New User


Joined: 27 Mar 2008
Posts: 3
Location: Mumbai

PostPosted: Thu Mar 29, 2012 7:23 pm    Post subject: Not able to execute the ISREDIT MACRO, getting RC 20
Reply with quote

Hi,

i just started working on edit macros, thus please bear if my query is silly one.

I have created few edit macros, which i am able to run in our system.
But below macro which i have written to edit the current dsn having the cobol code to expand the copybook is not working -

*************************************************************

Code:
/* REXX */                                                                                 
TRACE R                                                               
ADDRESS ISREDIT "MACRO"                                               
ADDRESS ISREDIT "(ROW,COL) = CURSOR"                                   
ADDRESS ISREDIT "(LINE) = LINENUM.ZCSR"                               
ADDRESS ISPEXEC CONTROL ERRORS RETURN                                 
CPYLIB = "NUTSO.SAROLIA.TEST"                           
LINE = SUBSTR(LINE,7,66)                                               
CMD = SUBWORD(LINE,1,1)                                               
CPY = SUBWORD(LINE,2,1)                                               
CMD = STRIP(CMD)                                                       
CPY = STRIP(CPY,'T','.')                                               
IF CMD \= 'COPY' OR CMD \= 'INCLUDE' THEN EXIT                         
ELSE CALL EXPAND_COPYBOOK                                             
                                                                       
EXPAND_COPYBOOK:                                                       
/* CHECK IF COPYBOOK EXISTS */                                         

DSN = CPYLIB || "("CPY")"                       
ADDRESS TSO                                     
RC = SYSDSN("'"DSN"'")                         
IF RC \= 'OK' THEN DO                           
  MSG = "COPYBOOK NOT FOUND:'" CPY "'"         
  ADDRESS ISREDIT "LINE_AFTER ROW'"MSG"'"       
  EXIT                                         
END                                             
                                               
/* READ COPYBOOK */                             
ADDRESS TSO                                     
"ALLOC FI(IFILE) DA('" || DSN || "') SHR"       
'EXECIO * DISKR IFILE (STEM BOOK.'             
'EXECIO 0 DISKR IFILE (FINIS'                   
'FREE F(IFILE)'                                 
ADDRESS ISREDIT                                 
                                               
/* PASTE COPYBOOK INTO PROGRAM SOURCE */           
J = 1                                             
DO UNTILL BOOK.J = ''                             
   MARK = '|++++|'                               
   TXT = SUBSTR(BOOK.J,7,66)                     
   ADDRESS ISREDIT "LINE_AFTER &ROW = '"TXT"'"   
   J = J + 1                                     
   ROW = ROW + 1                                 
END                                               
EXIT                                             

*************************************************************

Please note i have added the above code in member of correct library with name EXPAND, as i am able to run other macros.

But for above code when i give "EXPAND" on command line with cursor on "COPY COPYBOOKNAME" , it gives me error " command expand is not active "

And when i give "TSO EXPAND" it gives ne below error -

*-* ADDRESS ISREDIT "MACRO"
>>> "MACRO"
+++ RC(20) +++
*-* ADDRESS ISREDIT "(ROW,COL) = CURSOR"
>>> "(ROW,COL) = CURSOR"
+++ RC(20) +++
*-* ADDRESS ISREDIT "(LINE) = LINENUM.ZCSR"
>>> "(LINE) = LINENUM.ZCSR"
+++ RC(20) +++
*-* ADDRESS ISPEXEC CONTROL ERRORS RETURN
>>> "CONTROL ERRORS RETURN"
*-* CPYLIB = "ENDEVORD.PROD.GEXC.####.G.COPYLIB"
>>> "ENDEVORD.PROD.GEXC.####.G.COPYLIB"
*-* LINE = SUBSTR(LINE,7,66)
>>> "

*-* CMD = SUBWORD(LINE,1,1)
>>> ""
*-* CPY = SUBWORD(LINE,2,1)
>>> ""
*-* CMD = STRIP(CMD)
>>> ""
*-* CPY = STRIP(CPY,'T','.')

Please help.
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2025
Location: Silicon Valley

PostPosted: Thu Mar 29, 2012 8:05 pm    Post subject: Reply to: Not able to execute the ISREDIT MACRO, getting RC
Reply with quote

EXPAND is an ISPF command, so it is a restricted name. Rename your program. It is as if you had named your program to be 'END' or 'CANCEL'... ISPF will recognize it and try to do it.

I do not believe there is a list of restricted names, but if you go to ISPF option 3.9 and list the ISP command table, you can see what command names not to use.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Thu Mar 29, 2012 8:05 pm    Post subject:
Reply with quote

"Wij runderen, wij glunderen!"

Before you create an edit macro, it would be a good thing to press PF1 from the main ISPF menu, followed by "I" to look in the ISPF Tutorial Index if there is already a command with that name...
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7255

PostPosted: Thu Mar 29, 2012 8:12 pm    Post subject: Reply to: Not able to execute the ISREDIT MACRO, getting RC
Reply with quote

Another way is to give your macro a name which is not the first one you think of.

EXPAND is asking for trouble. It is a single word. If not used now, it could well be used in a later release. EXPCPYBK is much better. Unlikely to be used in future by system software, much more mnemonic than "EXPAND".
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 642
Location: Whitby, ON, Canada

PostPosted: Thu Mar 29, 2012 11:45 pm    Post subject:
Reply with quote

LOOK and ZOOM are two other common names for this kind of function. There may already be one of them in your shop.
Back to top
View user's profile Send private message
asarolia

New User


Joined: 27 Mar 2008
Posts: 3
Location: Mumbai

PostPosted: Fri Mar 30, 2012 9:30 am    Post subject:
Reply with quote

Hmm.. thanks a lot .. renaming the member made it to work. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm
No new posts Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm
No new posts RACF Easytrieve Plus macro Susan Jackson CA Products 0 Fri Jun 03, 2016 8:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us