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
 

 

How to execute a macro

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

New User


Joined: 31 Oct 2012
Posts: 31
Location: INDIA

PostPosted: Thu Feb 27, 2014 8:12 pm    Post subject: How to execute a macro
Reply with quote

Hi

I have coded macro with few tso commands like below in a separate member of pds

x 'cobol' all
del x all

And iam trying to execute this calling from another rexx program using jcl.

But the above coded macro is not working can any one please help.?

Regards
Sanath
Back to top
View user's profile Send private message

Pandora-Box

Moderator


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

PostPosted: Thu Feb 27, 2014 8:19 pm    Post subject:
Reply with quote

Hi,

Could you copy & paste the macro?

and when you say not working it doesn't help us much you got to give the details of not working like errors that you have got or any info which would help us to debug your code
Back to top
View user's profile Send private message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 31
Location: INDIA

PostPosted: Thu Feb 27, 2014 8:23 pm    Post subject: It is like this
Reply with quote

Example -

/* REXX */
ADDRESS ISPEXEC "EDIT DATASET('xk.prog.mclist') MACRO(test1)"

test1:
ADDRESS ISREDIT
x 'COBOL' ALL
DEL X ALL




WHERE AS xk.prog.mclist will contain some comments in the cobol code ,where i want to delete all the comented lines having "cobol".

Please help.The macro test1 is not working on the xk.prog.mclist.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Thu Feb 27, 2014 9:25 pm    Post subject:
Reply with quote

See Executing CLISTs in this manual or Running an EXEC in this manual.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


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

PostPosted: Thu Feb 27, 2014 9:42 pm    Post subject:
Reply with quote

FIR - What you have tried to code will delete all lines has 'cobol' irrespective of comment

At this moment not sure if your input file has only comments
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Feb 27, 2014 9:59 pm    Post subject: Reply to: How to execute a macro
Reply with quote

Quote:
from another rexx program using jcl.

Show us the JCL.

You have to use ISPSTART CMD(%myrexx)
and you have to have DD statements for all of the datasets required by ISPF.

And your editor macro needs to have an END.

You need to provide the symptoms of the 'it does not work' result.
Back to top
View user's profile Send private message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 31
Location: INDIA

PostPosted: Wed Mar 05, 2014 1:13 pm    Post subject: my jcl
Reply with quote

Code:
                                 
//*******************************************************************
//*------------------------------------------------------------------
//STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(0,NE)                 
//ISPPLIB  DD DSN=ISP.SISPPENU,DISP=SHR                             
//ISPSLIB  DD DSN=ISP.SISPSLIB,DISP=SHR                             
//         DD DSN=ISP.SISPSENU,DISP=SHR                             
//ISPMLIB  DD DSN=ISP.SISPMENU,DISP=SHR                             
//ISPPROF  DD DSN=UP8752.ISPF.PROFILE,DISP=SHR                       
//ISPTLIB  DD DSN=ISP.SISPTENU,DISP=SHR                             
//ISPLOG   DD SYSOUT=*,                                             
//            DCB=(LRECL=120,BLKSIZE=2400,DSORG=PS,RECFM=FB)         
//ISPLIST  DD SYSOUT=*,                                             
//            DCB=(LRECL=121,BLKSIZE=1210,RECFM=FBA)                 
//SYSEXEC  DD DSN=XX.JCLS,DISP=SHR                     
//         DD DSN=ISP.SISPEXEC,DISP=SHR                             
//SYSPROC  DD DSN=XX.JCLS,DISP=SHR                     
//         DD DSN=ISP.SISPCLIB,DISP=SHR                             
//SYSTSPRT DD SYSOUT=*                                               
//SYSTSIN  DD *                             
//*  PROFILE PREFIX(UP8752)                 
  ISPSTART CMD(%MACREXEC XK.SAMP.COB MAC2) 
/*                                         


Where as MACREXEC is having below REXX code

Quote:
/* REXX */
I=1
TRACE I
PARSE ARG XK.SAMP.COB MAC2
INP = "'"||XK.SAMP.COB||"'"
X=OUTTRAP(A.)
"LISTDS "INP" MEMBERS"
X = OUTTRAP("OFF")

DO I = 7 TO A.0
MEM = "'"||XK.SAMP.COB|| '('||STRIP(A.I)||')"'"
ADDRESS ISPEXEC
"EDIT DATASET("MEM") MACRO("MAC2")
END
EXIT


XK.SAMP.COB is the source code where the macro to be executed...

1PP 5668-958 IBM VS COBOL II Release 4.0 09/15/92
Code:
Invocation parameters:                                                 
 NOSEQ,QUOTE,OFFSET,LIB,RES,RENT,NODYNAM,DBCS,OPT,TRUNC(BIN),NUMPROC(NOP
0Options in effect:                                                     
       ADV                                                             
       QUOTE                                                           
     NOAWO                                                             
       BUFSIZE(4096)                                         


and MAC2 is the original macro that is below

ADDRESS ISREDIT
"MACRO"
"EXCLUDE ALL 'IBM VS COBOL II'"
"DELETE ALL X"
"SAVE"
"END"

But this jcl is giving RC 00 , but result of macro is not appearing in the source code dataset XK.SAMP.COB.Please advise.
and in sysout iam getting only below

READY
END
************
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1717
Location: UK

PostPosted: Wed Mar 05, 2014 2:46 pm    Post subject: Reply to: How to execute a macro
Reply with quote

As you should be aware by now, it helps if you use the code tags to present your code properly. Not using them means spaces can be removed so what you post is not a true representation of your code/JCL/control cards/data. It is possible that some people who might repond do not bother to respond those who do not bother to post in a manner that provides all possible assistance to the forum.

Now, what diagnostics have you tried? Trace? a few SAYs of relevant variables (eg the dataset that you are trying to edit)?
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed Mar 05, 2014 8:24 pm    Post subject: Reply to: How to execute a macro
Reply with quote

Code:
//SYSTSIN DD *
//* PROFILE PREFIX(UP8752)

You probably have no records in the SYSTSIN file. I think the first record terminates the flle.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1717
Location: UK

PostPosted: Wed Mar 05, 2014 9:29 pm    Post subject: Reply to: How to execute a macro
Reply with quote

If you have a look-see you will probably find a generated //SYSIN DD * because your //* terminates your SYSTSIN as it is a valid JCL card.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Wed Mar 05, 2014 10:41 pm    Post subject: Reply to: How to execute a macro
Reply with quote

And you'll need DD DATA, with a delimiter, instead of the DD * if you want to have anything which looks a bit like JCL/JECL/whatnot in your data-stream.
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