Page 1 of 1

Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 1:58 am
by Viswanathchandru
Dear all,

I can understand that a Macro can run only under ISPF. But I have a requirement where I need to open a dataset (View mode) issue "JEM"(Third party macro often called as Job scan) and capture the output. I'm wondering how to execute this. Any help or suggestions would be helpful. Hope I'm clear.


Regards,
Viswa

Re: Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 3:01 am
by Viswanathchandru
Thanks all, I was able to do.


Regards,
Viswa

Re: Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 3:55 am
by dick scherrer
Good to hear it is working - thank you for the update.

It will probably help someone else one with a similar issue if you post how you got this working :)

d

Re: Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 7:14 pm
by Viswanathchandru
Dear all,

Here is the snipet that worked.
OPN = 'JUSTIN'

X = OUTTRAP("OPT.")                                             
 ADDRESS TSO "LISTDS "PDS" M"                                       
X = OUTTRAP("OFF")                                                 
                                                                   
PDS = STRIP(PDS,"B","'")                                           
                                                                   
DO I = 7 TO OPT.0                                               
  OPT.I = STRIP(OPT.I)                                       
  ADDRESS ISPEXEC "VIEW DATASET ('"PDS"("OPT.I")') MACRO ("OPN")"
END.


However this opens the pds members in View mode and applies the Marco named OPN. But I'm facing some issues like I need to press F3 everytime to move on to the next member. Even after coding
"ISREDIT END" as the last edit statement I'm still facin issues. Any suggestions would be helpful.

Regards,
Viswa

Re: Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 7:37 pm
by enrico-sorichetti
I usually prefer doing everything using ISPF clauses (LMM..... stuff)

see here for a snippet using that approach

http://ibmmainframes.com/about25947.html

Re: Execute Macro outside a member.

PostPosted: Fri Dec 21, 2012 11:13 pm
by Viswanathchandru
Outstanding!!

Thanks enrico..

Regards,
Viswa