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
 

 

need to pass values thru parms from macro to another macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: need to pass values thru parms from macro to another macro
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Wed Jul 08, 2009 10:45 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 08, 2009 11:48 am    Post subject:
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    Post subject: Reply to: need to pass values thru parms from macro to anoth
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 08, 2009 2:02 pm    Post subject:
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: 1219
Location: Israel

PostPosted: Wed Jul 08, 2009 2:36 pm    Post subject: Reply to: need to pass values thru parms from macro to anoth
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

Senior Member


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

PostPosted: Wed Jul 08, 2009 9:11 pm    Post subject: Reply to: need to pass values thru parms from macro to anoth
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: 401
Location: Mumbai

PostPosted: Thu Jul 09, 2009 2:39 am    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jul 09, 2009 8:52 pm    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    Post subject:
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    Post subject: Reply to: need to pass values thru parms from macro to anoth
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

Moderator Team Head


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

PostPosted: Fri Jul 10, 2009 3:32 pm    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    Post subject: Reply to: need to pass values thru parms from macro to anoth
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    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 Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us