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

How to pass data to a macro


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

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Thu Oct 22, 2009 2:16 pm
Reply with quote

Hi,

I have coded a macro(Name M7) in to hilite the component depending upon whethere they are COBOL or JCL or control card program etc.
WHen i call this coded macro from other REXX program, like MACRO(M7) i am not able to passs the coponenet type to the macro, so that correspoding HILITE command can be executed from the proc.

How to pass data to this M7 macro coded in REXX when calling M7 from my Main program as ISREDIT EDIT DATASET(filename) MACRO(M7).

Pelase help me out.

Regards,
Naveen
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 22, 2009 2:28 pm
Reply with quote

Have you searched the forum because this has been asked and answered many times before.
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Thu Oct 22, 2009 3:15 pm
Reply with quote

Yes Expat. I couldnt get the answer. Please help me out with the link if possible.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 22, 2009 3:30 pm
Reply with quote

How to call a macro with parameters.

passing values to macro.

passing parameters to macros.

To pass parm to a macro from a CLIST.

How to pass parameters to a macro from rexx?
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Thu Oct 22, 2009 6:47 pm
Reply with quote

I tried VPUT then also i am not able to get the data inside my subrogram macro. I tried to display the data in the macro, it is displaying blank.

Mainprogram
Code:

PASSHI=HI.I                                         
ADDRESS ISPEXEC                                     
"VPUT  (PASSHI) PROFILE"                             
"VIEW DATASET('"DDIN1"') CHGWARN(YES) MACRO(WOW2)"   


subprogram macro WOW2
Code:
ADDRESS ISREDIT                     
"MACRO"                             
ADDRESS ISPEXEC "VGET PASSHI profile"
SAY "ISIDE MACRO = " PASSHI         
ADDRESS ISREDIT "HILITE '"PASSHI"'"
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Oct 23, 2009 2:15 am
Reply with quote

Try specifying SHARED instead of PROFILE.

Separately, check the syntax of the VIEW call... it has a PARM parameter. And I think you can get the parm in the MACRO statement.
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Fri Oct 23, 2009 12:41 pm
Reply with quote

You mean to say the code should be like this below?
1) SHARED is incorporated istead of PROFILE
2) the PASSHI variable is passed along with the Macro WOW2

Still it is not working.The latest code is below

Code:
PASSHI=HI.I                                         
ADDRESS ISPEXEC                                     
"VPUT  (PASSHI) SHARED"                             
"VIEW DATASET('"DDIN1"') CHGWARN(YES) MACRO(WOW2 PASSHI)"


Code:
ADDRESS ISREDIT                     
"MACRO"                             
ADDRESS ISPEXEC "VGET PASSHI SHARED"
SAY "ISIDE MACRO = " PASSHI         
ADDRESS ISREDIT "HILITE '"PASSHI"'"
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Oct 23, 2009 1:36 pm
Reply with quote

Code:
"ispexec lminit dataid(myid) dataset('my.dsn') enq(shrw)"

myparm = 'anyparm'
mymem  = 'anymem'
mymac  = 'anymac'
"ispexec edit dataid("myid") member("mymem") " ||,
                            "macro("mymac") parm(myparm)"

"ispexec lmfree dataid("myid")"


Watch what's quoted and what not!
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Oct 23, 2009 7:31 pm
Reply with quote

Code:
"VIEW DATASET('"DDIN1"') CHGWARN(YES) MACRO(WOW2 PASSHI)"


I am pretty sure I said to check the syntax... what you have should have given you a syntax error. I meant to check the manual.
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Fri Oct 23, 2009 7:35 pm
Reply with quote

Hi Prins, Thanka for the reply. but it didnt help. It didnt fufill my requirement. How the macro recieves the data passed in PARM ie myparm.
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Fri Oct 23, 2009 8:02 pm
Reply with quote

Pedra in this case how will we recieve the same in the macro WOW2?
I think there is some issue with the receieve of PASSHI.

Code:
ADDRESS ISREDIT                     
"MACRO"                             
ADDRESS ISPEXEC "VGET PASSHI SHARED"
SAY "ISIDE MACRO = " PASSHI         
ADDRESS ISREDIT "HILITE '"PASSHI"'"
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 23, 2009 8:31 pm
Reply with quote

why does no one check return codes?
Back to top
View user's profile Send private message
naveengec

New User


Joined: 24 Mar 2007
Posts: 35
Location: pune

PostPosted: Fri Oct 23, 2009 8:52 pm
Reply with quote

yes now it is working... I changed the code like this,,,..
Code:
ADDRESS ISPEXEC "VGET PASSHI"   
SAY "INSIDE MACRO = " PASSHI   
ADDRESS ISREDIT "HI "PASSHI     


Thanks Evryone once again for the prompt response.... Thanks very much..!!!![/quote]
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top