View previous topic :: View next topic
|
Author |
Message |
amit.sagar19
New User
Joined: 10 Nov 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
The macro need to be defined in the SYSPROC or SYSEXEC DD concatenation |
|
Back to top |
|
|
amit.sagar19
New User
Joined: 10 Nov 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
amit.sagar19
New User
Joined: 10 Nov 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
Where does "SITEMAC1" live? You may need to have that library concatenated to SYSEXEC or SYSPROC also. |
|
Back to top |
|
|
amit.sagar19
New User
Joined: 10 Nov 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
amit.sagar19
New User
Joined: 10 Nov 2011 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2596 Location: Silicon Valley
|
|
|
|
Code: |
ADDRESS TSO "%SPROC DS('LIB2.DB2.myname.mylib') ADD" |
SPROC is some exec local only to your system. |
|
Back to top |
|
|
|