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
 

 

Executing an ISPF Macro on a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Wed Nov 14, 2007 8:33 pm    Post subject: Executing an ISPF Macro on a file
Reply with quote

I have written an ISPF EDIT macro that will look for a certain string and informs us whether that particular string is there or not. This macro is working fine for the files which can be opened in view or edit mode.. But if we open the file in browse mode, it is not working ..As per my requirement it should work for files which are opened in browse mode..

Code:
dset = 'PID.PLI.PGMS(SCRAP)';                     
address ispexec "view dataset('"dset"') macro(ltype)";


the macro LTYPE is having the actual logic to search for a string in the given dataset..

if the given dataset can be opened in a VIEW mode, then the macro is running fine..but in some cases, the dataset can't be opened in view mode, in that case BROWSE mode is automatically applied.
In this kind of situations my macro is getting failed.

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

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Nov 14, 2007 8:43 pm    Post subject: Reply to: Executing a REXX Macro on a file
Reply with quote

Quote:
.As per my requirement it should work for files which are opened in browse mode..


As per doc an edit macro is an edit macro... not a browse macro !

For what reason the view is transformed in browse ??
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Wed Nov 14, 2007 9:00 pm    Post subject: Reply to: Executing an ISPF Macro on a file
Reply with quote

Hi Enrico,
Actually I am searching for a string in load modules..
All the load modules are get opened in browse mode only..they can't be opened in either VIEW or EDIT mode..
So in this kind of situation, can you please tell me what should be the best way to code a macro ?

Thanks and Regards,
Cheryala
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Nov 14, 2007 9:12 pm    Post subject: Reply to: Executing an ISPF Macro on a file
Reply with quote

are You doing any particular processing inside Your macro??

for a Yes/no solution ISPF searchfor will work also on load modules
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Wed Nov 14, 2007 9:29 pm    Post subject: Re: Reply to: Executing an ISPF Macro on a file
Reply with quote

Hi Enrico,
I have to look for existance of a certain string in some load modules using a REXX program. So just to automate this process, i developed this macro. This macro simply executes the following the below statements

Code:
address isredit "macro";

address isredit "find first 'search string'";
if rc = 0 then do;
/* return some value to main rexx pgm. */
end;
else do;
/* return some other value to main rexx pgm. */
end;

address isredit "end";   /* close the dataset  */



Based on the values from macro, my main rexx code has to do some processing...

Regards,
Cheryala
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Nov 15, 2007 11:44 am    Post subject:
Reply with quote

As enrico said, use SUPERC instead of macro.

O.
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Thu Nov 15, 2007 7:49 pm    Post subject: Reply to: Executing an ISPF Macro on a file
Reply with quote

Hi ,
As I would be using the information returned by this macro in another REXX program, it would be great if you let me know the alternatinve solution that will make it possible to look for existance of a certain string in a member (which is get opened in browse mode).

regards,
Cheryala
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Nov 16, 2007 12:54 am    Post subject:
Reply with quote

Don't open the dataset. Invoke SUPERC from within your REXX. Search the forum for examples.

O.
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Fri Nov 16, 2007 2:19 am    Post subject: Reply to: Executing an ISPF Macro on a file
Reply with quote

Hi , It would be a great help if you provide the link as I could not get any thing which is useful for me..

Thanks in Advance,
Regards,
Cheryala
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Nov 16, 2007 3:32 am    Post subject:
Reply with quote

There is a very good explanation, as well as an example, in the fine manual.

O.
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Fri Nov 16, 2007 6:37 pm    Post subject: Reply to: Executing an ISPF Macro on a file
Reply with quote

Hi Ofer71,
Thanks you very much for providing me the link...I followed the same steps given in the link and it is working for for me ...Thanks a lot once again.

With best regards,
Cheryala
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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