Customizing RDz remote search

News


Abstract

How to customize IBM Rational Developer for System z (RDz) via a plugin to search for occurrences of a string in members of a PDS

Content

The customization is composed of two parts:

  1. A REXX script performing the search on z/OS using the SUPERC command
  2. A plugin on the client side using the RDz Extensibility API to launch the REXX command on selected PDS or MVS filters

Part 1: REXX SUPERC1

The REXX script will call SUPERC passing in arguments the string to search and the PDS to search in (NEWDD).


"ALLOC FI(OUTDD) DA('"||OUTDD||"') MOD REUSE",
  " SPACE(100,100) DSORG(PS) RECFM(F,B) LRECL(80) BLKSIZE(800)"
 "ALLOC FI(NEWDD) DS(" pdsname ") SHR REUSE"
 "ALLOC F(SYSIN) NEW REU UNIT(VIO) RECFM(F B) LRECL(80)"
 QUEUE "SRCHFOR '"||str2find||"'"
 "EXECIO" QUEUED() "DISKW SYSIN(FINIS"

 "CALL *(ISRSUPC) 'SRCHCMP,ANYC,IDPFX,NOPRTCC'"

The result is redirected to a sequential dataset (OUTDD) which the REXX script will parse to find the summary section at the end, The summary will be sent to the RDz client plugin which will display it to the user..

Part 2: RDz custom plugin

The RDz plugin adds a menu to the Remote System Explorer by extending org.eclipse.ui.popupMenus:


<extension
  point="org.eclipse.ui.popupMenus">
  <objectContribution
   objectClass="com.ibm.ftt.resources.zos.zosphysical.ZOSResourceReference"
   id="com.ibm.support.rdz.search.contribution1">
    <menu
          label="%Menu.customer"
          path="additions"
          id="com.ibm.support.rdz.search.menu1">
        <separator
             name="group1">
        </separator>
    </menu>
    <action
      label="%Menu.search.label"
      class="com.ibm.support.rdz.search.ui.popup.actions.MyTsoSearchAction"
      menubarPath="com.ibm.support.rdz.search.menu1/group1"
      enablesFor="*"
      id="com.ibm.support.rdz.search.newAction">
    </action>

The REXX script on z/OS is called from com.ibm.support.rdz.search.MyTsoSearch


public String run(IOSImage conn, String pds, String token)
     throws OperationFailedException {
   IRemoteCommand remoteCommand = conn.getCommandObject();
   cmd = Messages.TSO_SEARCH_COMMAND;
   cmd=cmd.replaceFirst("arg_pds", pds);
   cmd=cmd.replaceFirst("arg_string", token);
   remoteCommand.setCommandString(cmd);
   //"exec 'user182.pmrs.rexx(search)' '''"+ pds + "'' " + token + "'");

   remoteCommand.run();
   return remoteCommand.getResults();
}

The TSO command is read from bundle file

<workspace>\com.ibm.support.rdz.search\src\com\ibm\support\rdz\search\ui\messages.properties:

TSO_SEARCH_COMMAND=exec 'user182.pmrs.rexx(superc1)' '''arg_pds'' arg_string'









See attachments below for a movie showing how to import the plugin project in RDz and how to run it.

Related information

RDz API
SuperC reference

Disclaimer:

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

demosearch.movie.zipdemosearch.movie.ziprdzsearchplugin.ziprdzsearchplugin.zipSUPERC1.rexSUPERC1.rex

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Developer for System z
General Information

Software version:

8.5.1

Operating system(s):

Windows, z/OS

Reference #:

1636415

Modified date:

2013-05-06

Translate my page

Machine Translation

Content navigation