View previous topic :: View next topic
|
Author |
Message |
Soumick Sarkar
New User
Joined: 28 Oct 2013 Posts: 15 Location: India
|
|
|
|
Hello,
I am trying to issue a srchfor command using macro facilities -
Code: |
ADDRESS ISPEXEC "EDIT DATASET('"DSN"') MACRO(SMMACRO)" |
But it is just opening the PDS and does nothing. I think the macro is not even getting called, as I even changed the macro name to some name and I didn't even got an error for ex. "macro name not found" or something like that.
Can't I use macro like this ? Or a macro can only be used in members opened in edit mode ? And by members I mean PS files.. |
|
Back to top |
|
|
Soumick Sarkar
New User
Joined: 28 Oct 2013 Posts: 15 Location: India
|
|
|
|
I tried by myself and observed that it is working for EDIT and VIEW, but only when I am specifying the member name as well.
(Sorry for posting without experimenting)
But isn't there any other way for srchfor ? |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Post your full code.
What is in your DSN? If its just your PDS name, the macro will not work. You have to be inside editor(inside a PDS member in VIEW or EDIT Mode) to make your macro work.
Lastly, is your macro SMMMACRO present in SYSPROC/EXEC libraries? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
They are called EDIT MACROS because they can run when you edit a file.
If you want to run it on members of a PDS, you have to edit the members (and execute the macro) one by one using a loop.
Can you explain why you use the term "SRCHFOR" ?
It is used by the Search-For Utility, and there could be other ways than to run a macro to reach your goal. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
Lastly, is your macro SMMMACRO present in SYSPROC/EXEC libraries? |
I suppose it was present otherwise he would got that error at the first place. |
|
Back to top |
|
|
Soumick Sarkar
New User
Joined: 28 Oct 2013 Posts: 15 Location: India
|
|
|
|
Full Code :
Code: |
LIBR = 'UINITB8.CLIST'
ZWINTTL = 'COPY PANEL'
"ISPEXEC LIBDEF ISPPLIB DATASET ID('"LIBR"')"
"ISPEXEC ADDPOP"
"ISPEXEC DISPLAY PANEL(COP)"
"ISPEXEC REMPOP"
ADDRESS ISPEXEC "BROWSE DATASET('"DSN"(LIST)') MACRO(SAMMACRO)" |
TheMFkid:
Yes, DSN contains only the DSN name not the member name. And I agree with you on this that it will not work like that. And yes, the macro SMMACRO is present in SYSPROC library.
Marso:
Quote: |
They are called EDIT MACROS because they can run when you edit a file. |
- i agree with you on this. And I was using the term "SRCHFOR" because I wanted to explore any way with which I can achieve the same functionality.
I guess macro is not the correct way, can you please guide me to the correct way ?
My aim is just to open a PDS issue a srchfor command for ex. "SRCHFOR ABC" and get the member names in which ABC is present.
According to my code a panel will open up and it will ask to enter the desired DSN name after entering the DSN name, the DSN will open up and that's it. I am just expecting to issue a SRCHFOR here. |
|
Back to top |
|
|
Soumick Sarkar
New User
Joined: 28 Oct 2013 Posts: 15 Location: India
|
|
|
|
Code: |
ADDRESS ISPEXEC "BROWSE DATASET('"DSN"(LIST)') MACRO(SAMMACRO)" |
Please ignore this line as I was testing and forgot to change it back.
Please read this as -
Code: |
ADDRESS ISPEXEC "EDIT DATASET('"DSN"') MACRO(SAMMACRO)" |
|
|
Back to top |
|
|
Ranjithkumar
New User
Joined: 10 Sep 2008 Posts: 93 Location: India
|
|
|
|
Soumick
As Rohit mentioned ISRSUPC is already available in Batch. If you want to do this through REXX , you have to execute ISRSUPC module via REXX, which is what option 3.14 / 3.15 in ISPF Menu does. |
|
Back to top |
|
|
Soumick Sarkar
New User
Joined: 28 Oct 2013 Posts: 15 Location: India
|
|
|
|
Oh.. All right. i will try that now. Thanks for helping out guys |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
SRCHFOR is a primary command that can be issued from the member list display. It was not stated clearly by the OP, but I think the intent was to display a member list that indicated which members had the search text.
I have been interested in SRCHFOR for some time, so I took this on as a challenge.
I was able to do what you want with a modified member list panel, ISREPO01. (Yeah, I know that modifying ISPF product panels is frowned upon. I made my own copy).
My driving program:
Code: |
/* rexx */
Address ISPEXEC
mysrch = 'TEST'
"VIEW DATASET(my.clist) PANEL(MYPEO01)" |
The modified panel ISREPO01 has this just before the )PROC statement:
Code: |
If (&mysrch ¬= &z)
&zcmd = 'SRCHFOR &mysrch'
&mysrch = &z
.resp = ENTER |
The member list is shown as:
Code: |
VIEW PEDRO.MY.CLIST String(s) found
Command ===> Scroll ===> CSR
Name Prompt Size Created Changed ID
. $DDL3 *Found 30 2011/01/12 2011/01/12 12:15:56 xxx
. $DDL6 16 2011/01/25 2011/01/25 10:49:04 xxx
. $DDL7 *Found 32 2011/01/31 2011/01/31 14:26:04 xxx
. $DDL8 *Found 14 2011/02/10 2011/02/10 11:24:44 xxx |
Though, I think it might be easier to just teach your users how to use the SRCHFOR primary command. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
The driving program should be:
Code: |
/* rexx */
Address ISPEXEC
mysrch = 'TEST'
"VIEW DATASET(my.clist)" |
|
|
Back to top |
|
|
|