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
 

 

Trying to use SRCHFOR using a macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Soumick Sarkar

New User


Joined: 28 Oct 2013
Posts: 15
Location: India

PostPosted: Wed Mar 26, 2014 12:40 pm    Post subject: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message

Soumick Sarkar

New User


Joined: 28 Oct 2013
Posts: 15
Location: India

PostPosted: Wed Mar 26, 2014 12:52 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Mar 26, 2014 1:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Wed Mar 26, 2014 2:02 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Mar 26, 2014 2:10 pm    Post subject:
Reply with quote

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ISPZEM40/CCONTENTS?SHELF=ispzpm40&DN=SC34-4820-04&DT=20050712213335

Why do you need to make another macro over SRCHFOR? You can also do this via batch.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Mar 26, 2014 2:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Soumick Sarkar

New User


Joined: 28 Oct 2013
Posts: 15
Location: India

PostPosted: Wed Mar 26, 2014 2:16 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
Soumick Sarkar

New User


Joined: 28 Oct 2013
Posts: 15
Location: India

PostPosted: Wed Mar 26, 2014 2:32 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 94
Location: India

PostPosted: Wed Mar 26, 2014 2:52 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
Soumick Sarkar

New User


Joined: 28 Oct 2013
Posts: 15
Location: India

PostPosted: Wed Mar 26, 2014 2:59 pm    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

Oh.. All right. i will try that now. Thanks for helping out guys icon_smile.gif
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Mar 27, 2014 5:42 am    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Mar 27, 2014 5:55 am    Post subject: Reply to: Trying to use SRCHFOR using a macro
Reply with quote

The driving program should be:
Code:
/* rexx */                 
Address ISPEXEC           
mysrch = 'TEST'           
"VIEW DATASET(my.clist)"
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm
No new posts Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm
No new posts RACF Easytrieve Plus macro Susan Jackson CA Products 0 Fri Jun 03, 2016 8:25 pm
No new posts ISRSUPC SRCHFOR tool - Query while us... soundarr JCL & VSAM 7 Wed Mar 16, 2016 8:55 pm
No new posts Calling macro via rexx in batch mode. SanaR CLIST & REXX 15 Tue Mar 08, 2016 4:46 pm


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