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

How to execute a macro


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 30
Location: INDIA

PostPosted: Thu Feb 27, 2014 8:12 pm
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

Global Moderator


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

PostPosted: Thu Feb 27, 2014 8:19 pm
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: 30
Location: INDIA

PostPosted: Thu Feb 27, 2014 8:23 pm
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 Member


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

PostPosted: Thu Feb 27, 2014 9:25 pm
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

Global Moderator


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

PostPosted: Thu Feb 27, 2014 9:42 pm
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

Global Moderator


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

PostPosted: Thu Feb 27, 2014 9:59 pm
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: 30
Location: INDIA

PostPosted: Wed Mar 05, 2014 1:13 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed Mar 05, 2014 2:46 pm
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

Global Moderator


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

PostPosted: Wed Mar 05, 2014 8:24 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed Mar 05, 2014 9:29 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Wed Mar 05, 2014 10:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts Identify the count from two diffrent ... DFSORT/ICETOOL 19
No new posts ISPF Edit Macro with profile commands... TSO/ISPF 14
No new posts TSO and the STAX Assembler Macro PL/I & Assembler 43
No new posts Need to open a DSN using REXX & e... CLIST & REXX 10
Search our Forums:

Back to Top