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

need to pass values thru parms from macro to another macro


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

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Wed Jul 08, 2009 10:36 am
Reply with quote

Hi all,
I am trying to execute one macro inside a member from another macro. While trying to execute i am not able to pass parms to that macro icon_cry.gif .When i execute SECMAC macro, it recieves parms and
executes successfully. But when I pass it from FIRSTMAC, it is not executing and returns a return code of 20 and says the following error
"ISPS109
Unexpected list found
A list of names was found where a list was not expected."



Following is the code.
TEST.ONE(FIRSTMAC):
--------------------------
/*REXX*/
ADDRESS ISREDIT 'MACRO PROCESS'
SAY "PDS"
PULL PDS
s1='yuva'
ADDRESS TSO "LISTDS '"PDS"' MEMBERS"
do i = 7 to stem.0
member = strip(stem.i)
dset = pds||'('||member||')'
ADDRESS ISPEXEC "EDIT DATASET('"DSET"') MACR(SECMAC "s1")"
END
EXIT


TEST.ONE(SECMAC):
------------------------
/*REXX*/
ADDRESS ISREDIT "MACRO (PARM) NOPROCESS"
PARSE UPPER VAR PARM S1 S2
SAY S1
SAY S2
EXIT

[/img]
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Wed Jul 08, 2009 10:45 am
Reply with quote

Please read the fine manual?


MODEL CLASS REXX
MODEL M4

WARNING: DO NOT ABUSE. EDITED
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jul 08, 2009 11:48 am
Reply with quote

I can not see the point in making the first one a macro, any reason ?
Back to top
View user's profile Send private message
yuvaraj84

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Wed Jul 08, 2009 1:53 pm
Reply with quote

Hi expat,
sorry icon_sad.gif . I gave the SECMAC macro only as an example. Here is the exact
SECMAC macro. It searches for the variable passed from FIRSTMAC and
writes to the file.


TEST.ONE(SECMAC):
------------------------
/*REXX*/
ADDRESS ISREDIT "MACRO (PARM) NOPROCESS"
o1=test.file.output
ADDRESS TSO "ALLOC DD(PDSID) DA("O1") MOD REUSE"
PARSE UPPER VAR PARM VAR1
DO 1
ADDRESS ISREDIT "FIND ALL "VAR1""
ADDRESS ISPEXEC "ISREDIT (CNTS) = FIND_COUNTS"
ADDRESS ISREDIT "(MEMNAME) = MEMBER"
S1CNT= CNTS
MEMDTL = RIGHT(STRIP(MEMNAME),12,' ')
MEMDTL = MEMDTL||RIGHT(STRIP(S1CNT),12,' ')
QUEUE MEMDTL
ADDRESS TSO "EXECIO "QUEUED()" DISKW PDSID (FINIS"
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: Wed Jul 08, 2009 2:02 pm
Reply with quote

This topic has been discussed various times on the forum, and has been answered.

Also, the ISPF Edit and Edit Macro manual (Easily available from the sticky in the REXX / CLIST forum) gives advice for passing parameters to an edit macro.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jul 08, 2009 2:36 pm
Reply with quote

Is FIRSTMAC given as an example too?
because it cannot work... when is the variable "stem." initialized???

Oh, SECMAC doesn't work either: each time you do your EXECIO DISKW, the previous content is lost... icon_cry.gif

And why not use ISRSUPC ? it would be much much faster.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jul 08, 2009 9:11 pm
Reply with quote

The syntax is:
Code:

 ISPEXEC  EDIT  DATAID(dsname)   [MEMBER(member-name)]
                                 [MACRO(macro-name)]   

That's macro-name, not macro-name and parms.

If you need to pass information to it, use VPUT in the caller and VGET in the callee.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Jul 09, 2009 2:39 am
Reply with quote

Actually, according to the ffing manual, it is
Code:
     ISPEXEC  EDIT  DATASET(dsname)  [VOLUME(serial)]
                                     [PASSWORD(pswd-value)]
                                     [PANEL(panel-name)]
                                     [MACRO(macro-name)]
                                     [PROFILE(profile-name)]
                                     [FORMAT(format-name)]
                                     [MIXED(YES|NO)]
                                     [LOCK(YES|NO)]
                                     [CONFIRM(YES|NO)]
                                     [WS(YES|NO)]
                                     [WRAP]
                                     [PRESERVE]
                                     [PARM(parm-var)]
See the PARM(parm-var) parameter. Use vput/vget or any other method if you need to pass data back from the 2nd macro
Back to top
View user's profile Send private message
yuvaraj84

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Thu Jul 09, 2009 10:46 am
Reply with quote

Thanks a lot expat,Mbabu and Pedro. I got the syntax. I hope there i won't encounter any problem. icon_biggrin.gif

Hi Marso,
Since I am using MOD, the data would get appended. The previous data would not get lost. You can also try and see. icon_biggrin.gif
Back to top
View user's profile Send private message
yuvaraj84

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Thu Jul 09, 2009 8:05 pm
Reply with quote

Hi,
Second macro is not getting executed even after changing the parms parameter. The parm is not passed icon_cry.gif .This is the new syntax with which i have run. But the return code is 0. I am not able to trace it out what is missing.

Following is the code.
TEST.ONE(FIRSTMAC):
--------------------------
/*REXX*/
ADDRESS ISREDIT 'MACRO PROCESS'
SAY "PDS"
PULL PDS
s1='yuva'
ADDRESS TSO "LISTDS '"PDS"' MEMBERS"
do i = 7 to stem.0
member = strip(stem.i)
dset = pds||'('||member||')'
ADDRESS ISPEXEC "EDIT DATASET('"DSET"') MACRO(SECMAC) PARM("S1")"
END
EXIT
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 09, 2009 8:32 pm
Reply with quote

parm-var
The name of an ISPF variable that contains parameters

you vput your data in parm variable s1 from first rexx

you vget your data to s1 from second rexx
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 Jul 09, 2009 8:52 pm
Reply with quote

OK. These two macros worked for me:

MAC1:
Code:

/* REXX */
"ISREDIT MACRO PROCESS"
Say "PDS"
Pull pds
s1 = "yuva"
Call Outtrap(ml.)
"LISTDS "pds" MEMBERS"
Call Outtrap(off)
Do i = 7 To ml.0
  dset = pds||"("||Strip(ml.i)||")"
  "ISPEXEC EDIT DATASET("dset") MACRO(MAC2) PARM(s1)"
End
Exit 0


MAC2:
Code:

/* REXX */
"ISREDIT MACRO (parm) NOPROCESS"
o1 = TEST.FILE.OUTPUT
"ALLOC DD(pdsid) DA("o1") MOD REU"
Parse Var parm var1 .
"ISREDIT FIND ALL "var1
"ISREDIT (cnts) = FIND_COUNTS"
"ISREDIT (memname) = MEMBER"
memdtl = Right(Strip(memname),12," ")
memdtl = memdtl||Right(Strip(cnts),12," ")
Queue memdtl
"EXECIO "Queued()" DISKW pdsid (FINIS"
"ISREDIT END"
Exit 0
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 09, 2009 9:41 pm
Reply with quote

duh! Guess you don't need to store and access variable pool. 2020.gif
Back to top
View user's profile Send private message
yuvaraj84

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Fri Jul 10, 2009 10:32 am
Reply with quote

Thanks a lot dbzTHEdinosauer and superk finally the macro worked. icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Jul 10, 2009 3:32 pm
Reply with quote

What was wrong? icon_question.gif
Back to top
View user's profile Send private message
yuvaraj84

New User


Joined: 04 Jun 2007
Posts: 6
Location: india

PostPosted: Fri Jul 10, 2009 7:28 pm
Reply with quote

Hi superk,
macro worked with spool variables. Still analyzing, i will post once i debug.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top