View previous topic :: View next topic
|
Author |
Message |
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
As enrico said, use SUPERC instead of macro.
O. |
|
Back to top |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Don't open the dataset. Invoke SUPERC from within your REXX. Search the forum for examples.
O. |
|
Back to top |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
There is a very good explanation, as well as an example, in the fine manual.
O. |
|
Back to top |
|
|
cheryala
New User
Joined: 20 Mar 2006 Posts: 46
|
|
|
|
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 |
|
|
|