IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Runnin an ISREDIT MACRO


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amit.sagar19

New User


Joined: 10 Nov 2011
Posts: 5
Location: India

PostPosted: Tue Dec 20, 2011 4:04 pm
Reply with quote

Here’s the code which executes a macro named ‘MYMACRO’.

If the macro is called I get the error - COMMAND MYMACRO NOT FOUND
***

Code:

/* REXX */                                                 
INDSN="'LIB2.DB2.J251114.DDL(CR0111AJ)'"                   
ADDRESS ISPEXEC "EDIT DATASET("||INDSN||") MACRO("MYMACRO")"
EXIT



Code:
/* REXX */                                                     
ADDRESS ISREDIT "MACRO("STRING")"                             
ADDRESS ISPEXEC "VPUT  STRING"                               
ADDRESS ISREDIT "RESET EXCLUDED"                             
ADDRESS ISREDIT "EXCLUDE ALL 'CRMFNX00'"                     
ADDRESS ISREDIT "FIND ALL 'CRMFNX00'"                         
  IF RC > 0 THEN EXIT                                         
ADDRESS ISREDIT "CHANGE 'CRMFNX00' 'CRMFNXS6' ALL"           
ADDRESS ISREDIT "SAVE"                                       
ADDRESS ISREDIT "END"                                         
  EXIT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Dec 20, 2011 4:29 pm
Reply with quote

The macro need to be defined in the SYSPROC or SYSEXEC DD concatenation
Back to top
View user's profile Send private message
amit.sagar19

New User


Joined: 10 Nov 2011
Posts: 5
Location: India

PostPosted: Tue Dec 20, 2011 6:24 pm
Reply with quote

Hi Expat,
Thanks for the suggestions.
Here's the JCL which I used to call the REXX 'MCALL' (which in turn runs macro MYMACRO) :

Code:

//STEPNAME EXEC PGM=IKJEFT01                                     
//ISPLOG DD SYSOUT=*,DCB=(LRECL=125,BLKSIZE=129,RECFM=VA)       
//ISPPROF DD DSN=&&TEMP,DISP=(NEW,PASS),UNIT=SYSDA,             
//           DCB=(RECFM=FB,LRECL=80,DSORG=PO),SPACE=(TRK,(1,1,5))
//ISPLLIB DD DSN=SYS1.SISPLOAD,DISP=SHR                         
//ISPMLIB DD DSN=SYS1.SISPMENU,DISP=SHR                         
//ISPPLIB DD DSN=SYS1.SISPPENU,DISP=SHR                         
//ISPSLIB DD DSN=SYS1.SISPSLIB,DISP=SHR                         
//ISPTLIB DD DSN=SYS1.SISPTENU,DISP=SHR                         
//SYSPROC DD DSN=SYS1.SISPEXEC,DISP=SHR                         
//SYSTSPRT DD SYSOUT=*                                           
//SYSEXEC DD DSN=LIB2.DB2.J251114.LOAD,DISP=SHR                 
//SYSTSIN DD *                                                   
ISPSTART CMD(%MCALL)                                             
/*                                                               
// 



The JCL fails and gives the following error message:
[Panel ISREDDE3 message - In batch, the following message was displayed on the panel.
Macro does not exist - Initial or recovery macro "SITEMAC1" could not be executed.
TSO - Command - - %SITEMAC1 ]

Please advise what is missing.

Second Question:
What if I try to execute by giving 'EX' against the REXX exec? In such a case, how are the ISPLIBs (as included in the JCL) included?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Dec 20, 2011 7:46 pm
Reply with quote

You've allocated:

Code:

//SYSPROC DD DSN=SYS1.SISPEXEC,DISP=SHR                                     
//SYSEXEC DD DSN=LIB2.DB2.J251114.LOAD,DISP=SHR


Which one contains your ISPF Edit Macro (MYMACRO)?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Dec 21, 2011 3:44 am
Reply with quote

Hi,

Quote:
What if I try to execute by giving 'EX' against the REXX exec? In such a case, how are the ISPLIBs (as included in the JCL) included?

Your logon PROC would have allocated the ISPLIB's.

Type TSO ISRDDN, it provides a list of allocated DD names

Also is LIB2.DB2.J251114.LOAD truly a load library ?

A load library part of SYSEXEC DD ?

Gerry
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Dec 21, 2011 3:47 pm
Reply with quote

For your second question why not try - BPXWDYN:
Code:
/* REXX */                                       
"ALLOC F(MYPDS) DA('your.pds') SHR REU"   
CALL BPXWDYN "CONCAT DDLIST(SYSPROC,MYPDS) MSG(2)"
EXIT 0                                           
That way you can use use MACRO as a macro actually.
Back to top
View user's profile Send private message
amit.sagar19

New User


Joined: 10 Nov 2011
Posts: 5
Location: India

PostPosted: Wed Dec 21, 2011 10:24 pm
Reply with quote

My macro MYMACRO is present in the library LIB2.DB2.J251114.LOAD.
This library also contains the REXX which runs this macro.

Moreover, the library in SYSEXEC DD statement is not a load lib. It is just the name of my PDS is LIB2.DB2.J251114.LOAD
Back to top
View user's profile Send private message
don.leahy

Active Member


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

PostPosted: Wed Dec 21, 2011 11:42 pm
Reply with quote

Where does "SITEMAC1" live? You may need to have that library concatenated to SYSEXEC or SYSPROC also.
Back to top
View user's profile Send private message
amit.sagar19

New User


Joined: 10 Nov 2011
Posts: 5
Location: India

PostPosted: Mon Dec 26, 2011 7:14 pm
Reply with quote

Hi Don.Leahy,

I am not sure where to find the SITEMAC1 initial macro.
Can you suggest me a way to find it?

I checked the PROFILE by editing a member and found IMACRO is set to NONE.

But, the trace generated by TSO ISPVCALL STATUS gives Site Initial Macro as SITEMAC1.

Further, I am not able to run the command TSO ISPCCONF which could help find the 'Keyword File' / Configuration table.

Please advise.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Dec 26, 2011 7:26 pm
Reply with quote

Hi Amit sagar,

If you are not able to find SITEMAC1 library you can get in touch with SMEs or leads or ADMIN guys who knows more about the system.
Back to top
View user's profile Send private message
amit.sagar19

New User


Joined: 10 Nov 2011
Posts: 5
Location: India

PostPosted: Tue Dec 27, 2011 12:51 pm
Reply with quote

Finally, with all your help I am able to run the macro.
There are several ways to do this:

1) Using a batch (JCL) job:
Add xxx1.SYSPROC which contains the initial macro in the JCL ddname concatenation. For example:

//SYSPROC DD DSN=xxx1.SISPEXEC,DISP=SHR
// DD DSN=xxx1.SYSPROC,DISP=SHR

2) Another way to achieve this is to directly call the macro on the member to be edited.
- TSO ISRDDN > Check if the library containing your macro is listed here with ddname as SYSPROC.
- If not then add then add it using following code in a REXX.
ADDRESS TSO "%SPROC DS('LIB2.DB2.myname.mylib') ADD"
- Now you can see the library listed as :
Volume Disposition Act DDname Data Set Name Actions:
PA1270 SHR,KEEP > SYSPROC LIB2.DB2.myname.mylib
- Edit the member you want the macro to run on and type KEYS. Map your macro name to any of the function keys of your choice, say PF4.
- Once the key is mapped, you can go to the member and press PF4 to run the macro.

Thanks everyone for your valuable inputs.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jan 04, 2012 12:52 am
Reply with quote

Code:
ADDRESS TSO "%SPROC DS('LIB2.DB2.myname.mylib') ADD"

SPROC is some exec local only to your system.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
No new posts Facing issue in Run Edit Macro Job CLIST & REXX 9
No new posts outtrap does not capture within an ed... CLIST & REXX 1
Search our Forums:

Back to Top