Professional Documents
Culture Documents
RDZ Search Options
RDZ Search Options
All rights reserved – including the right to use these materials for RDz instruction.
The information contained in these materials is provided for informational purposes only, and is
provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible
for any damages arising out of the use of, or otherwise related to, these materials. Nothing
contained in these materials is intended to, nor shall have the effect of, creating any warranties
or representations from IBM or its suppliers or licensors, or altering the terms and conditions of
the applicable license agreement governing the use of IBM software. References in these
materials to IBM products, programs, or services do not imply that they will be available in all
countries in which IBM operates.
This information is based on current IBM product plans and strategy, which are subject to change
by IBM without notice. Product release dates and/or capabilities referenced in these materials
may change at any time at IBM’s sole discretion based on market opportunities or other factors,
and are not intended to be a commitment to future product or feature availability in any way.
IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and other IBM
Rational products and services are trademarks or registered trademarks of the International
Business Machines Corporation, in the United States, other countries or both. Other company,
product, or service names may be trademarks or service marks of others.
2
UNIT The RDz Workbench
Topics:
z/OS Remote Search
Program Search
3
Remote z/OS Search
Using Search you can search
for wildcard strings
throughout an LPAR
(connection) across PDS
datasets with differing
high-level qualifiers, and
including offline and
migrated content
4
Customizing the Search Dialog
Out of the box, RDz’s Search Dialog displays every installed search option. You will not need
them all.
Click Customize
From the Search Page Selection
Click Deselect All
Check just those search options you want to see
Click OK
Left-click / Hold and drag the left-hand margin of the Search page to make it a thin Rectangle (see next slide)
5
Remote z/OS Search – Options in the Search View
Compact U.I.
Hyper-text linked Search Results Type of Dataset
Hover/Peek into Search Results Member name pattern
Search for text pattern
Search specifically for:
Text patterns within libraries
Text patterns within sequential datasets
EBCDIC (hex) values
Specific library members
Specific data sets:
QSAM (sequential)
PDS members with a wildcard name What DSN or what selected
pattern DSNs to search
Can Filter result set lines
Optimize (buffer) search results
view build-out
Search using Regular expressions
Searching Options
Change "search for" criteria on-the-fly
Cancel long-running searches
Note that, TSO/ISPF SuperC and SearchFor utilities do
Save Search results not take into account Code Pages. RDz’s Remote z/OS
Search does (take Code Pages into account).
Save combine with update for
Search/Replace Searches for non-English characters (i.e. German
umlaut, Spanish inverted question and exclamation marks,
Leverage the name and Results view DBCS characters) are more accurate using RDz
for functionality
6
Search Results Loads the source file, and positions
the current-line
7
Search Result Set Filter – Logically "AND’ng“ Your Search Results
8
z/OS Remote Search Results view Preview
RDz provides an ability to peek at a few lines of code before downloading/opening the file that
contains statements/records that match your search pattern text
This (preview ability) provides context around the found result line, and can save time and
machine resources
You may not have to download file to find out if it contains what you need as per your
requirement – you can just peek at the surrounding lines/records
9 9
Note: Requires 8.5 Server
Sorting Search Results – on Last Modified
Once your Search finishes, you can sort by any category
(column) in the results view.
Last Modified is one of the more popular sorts
Or Created
10
Saving Remote Search Queries (all versions) – 1 of 3
You can save a Remote z/OS® Search query and run it from the Remote Systems view.
Before you can save a search query, you must first run a remote z/OS search and have the search results
displayed in the Remote z/OS Search view. This option is limited to a single z/OS system under the following
conditions:
You search for files using a resource name pattern and the file content search string is not specified.
The search scope is for a single z/OS system. The scope can be an entire z/OS system or multiple
partitioned data sets on the same system.
The search scope does not include z/OS projects or MVS™ subprojects.
11
Saving Remote Search Queries – 2 of 3
In the Remote z/OS Search view, display the results of the search query you want to save. If you have done
more than one search, use the drop-down search history list to select the search query you want to save.
Click the icon to save the search query. This icon is enabled only if the search scope is limited to a
single z/OS system under the following conditions:
You search for files using a resource name pattern and the file content search string is not specified
The search scope is for a single z/OS system. The scope can be an entire z/OS system or multiple partitioned
data sets on the same system
The search scope does not include z/OS projects or MVS™ subprojects
The Add Query to Remote Systems View window opens.
Type a name for the query and click OK. The search query is added to the
My Search Queries list under the MVS Files subsystem
12
Saving Remote Search Queries – 3 of 3
After you have saved a search query, you can do the following actions:
To run a saved query, select it in the Remote Systems view and click Run Query
from the pop-up menu.
To edit and run a saved query, select it in the Remote Systems view and click
Edit and Run from the pop-up menu.
This action opens the Remote z/OS Search window, which you can use to
change the search criteria and submit the search request.
13
Search in Options
Two options for searching:
1. Search inside the DSNs organized by Filters
Convenient for "selection-based" searching
Can select multiple DSNs
14
Optional Topic - RDz Search …vs… SRCHFOR (TSO/ISPF)
During one of my classes I got asked "Why use RDz's Search... Why not just use SRCHFOR?". So I compiled this list. And
although it's probably not complete - it paints a pretty clear picture of what RDz's Search can do that SRCHFOR does not:
15
Optional Topic - z/OS Search Dialog – EBCDIC Hex/Binary Search
16
Note: This feature requires 8.5 Server
Optional Topic - Search Results view toolbar options
Expand/Collapse
17 17
Optional Topic – Global change based on output of Search
Sometimes you need to make a global change – and it would be nice to use
the “found” modules from an RDz Search
It would also be nice to confine the changes you make into something like a
“sandbox” environment – in order to not affect Production
(or even Test trending towards Production)
To do this:
Issue Search
Click OK …or…
21
Additional Use Cases – Remote Search with Regular Expressions
1. Using Search and Regular Expressions, find Examples
out what COBOL programs in the libraries
could be affected by a change to the DB2
tables (use your programs or the RDzClass
code you copied up to your mainframe PDS)
WARD_DATA|HOSP_BED
22
Additional Use Cases – More Complex Regular Expressions
1. Search for COMPUTE statements in any module inside of <HLQ>.TEST.COBOL
where the member name begins with: TR or BN.
Use the Regular Expression: (*TR.*|BN.*)
23
Additional Use Cases – Search for the latest generation in a GDG
1. Select Sequential data set
2. Select Other contexts:
3. Type your file name in, and click Search
24
Leveraging the File Lists Created by Remote Search
The search results list contains dataset and member names - which be:
Copied/pasted (file transferred) to:
Other LPARS – that you can set up as a connection in RSE, and to your workstation
Added to MVS SubProjects:
MVS SubProjects are topics covered in another module of this course
Searched again:
Issue a search within the results list - allowing you to AND multiple search patterns
Compared with – Visual source compare
25
Using Remote Search on Individual Members of a Library
Remote Search is not limited to entire
libraries at-a-time
26
Searching Through Sequential Datasets
You can select one or more QSAM files, and search through them for
Content Strings
CA Endevor:
• Any 'Endevor target file' as written to by a Endevor processor
(normally a PDS/PDSe) can be searched via RDz Remote z/OS Search
• The internal Endevor file's such as the MCF, or BASE ELIBS can not
be searched due to the internal structure of these by Endevor.
CA Panvalet / CA Librarian:
• Search of these internal files is similar to CA Endevor.
• If the output or control files is a PDS/PDSe then RDz SEARCH is
available via Remote Search facility
• The internal Panvalet/Librarian files are VSAM, and can only be
searched using File Manager
Serena Changeman:
• Changeman keeps all source within PDS/PDSe's file so normal RDz
search available.
28 28
Searching Through MVS File Filters
You can Filters to organize disparate DSNs – then Search through all of the
datasets in the Filters with one action (Filters are in the next course module)
29
Search vs. Remote Index Search
Use Search as your default search for analysis and discovery
tasks:
For "One-off" (unique) searches:
When the libraries or member selection you're searching are unique combinations
When the files you're searching are dynamic:
The content within the members changes – and you need to search against the changed content
When you wish to:
Save and reuse your Search Results
Utilize Regular Expressions for complex search requirements
Search freely across your LPAR (Remote Index Search is only available against datasets in a Filter)
Filter your results set (happens on the client, not in z/OS)
Use Remote Index Search (covered in the Optional section of this module) only:
When the libraries you're searching are static:
The content within the members changes infrequently
Good candidates are entities like: CORP.PROD.COBOL, CORP.PROD.COPYLIB
When you wish to save MIPS searching against only static libraries:
Searching through the created remote index is relatively inexpensive – compared to Search
However, building the Remote Index is expensive – consider this carefully
When you wish to format the results
And when you DO NOT need to:
Use Regular Expressions
Save and reuse Search Results
Search QSAM files See slide notes for additional information on
30 Remote Index USS requirements
Advanced Topic - Remote Index Search – 1 of 3
There is another search mechanism available for RSE against
PDS datasets called a "Remote Index Search"
This search has two stages:
1. Create an index, from the text inside the file
This creates a "Lucene index" (see slide notes)
Index creation is relatively expensive
1.
2. Search against the index
Can search against all members in the indexed PDS
Or members with names of a given pattern
Searching the remote index is both fast and inexpensive
2a.
2b.
31
Advanced Topic - Remote Index Search – 2 of 3
Lucene index searches are sometimes faster than Remote Search. And you can still
double-click an entry to load the source into RDz and position your cursor
32
Advanced Topic - Remote Index Search – 3 of 3
Considerations:
Remote Index Search allows you to search
against all of the files in an entire Filter,
including:
Retrieved Data Sets
My Data Sets
Custom Filters
Consider the cost of indexing and searching
against a very large codebase
Retrieve Data Sets Lucene Index search is
done in using Java – so it will be faster
(and cheaper) if your z/OS has a zaap
processor installed
33
Advanced Topic - Remote Index Search –
Export Results – 1 of 2
34
Advanced Topic - Remote Index Search – Export Results – 2 of 2
The exported
results create a
plain-text file,
which you can
copy into other
more useful
analysis
formats
(Excel, etc.)
1. Export creates
35
Advanced Topic - New Remote Index Search Options
36
UNIT RDz for ISPF Developers
Topics:
Code Search – The Find and Replace Dialog
37
Find/Replace Dialog – 1 of 4 – Alternative Searching Functionality
Besides the ISPF Find/Change
command, there are other
ways to search and replace
text within a file
38
See Notes
Find/Replace Dialog – 2 of 4 – Options
Next
– Find forward in the source
– Does not find text inside copy or include files
– Ctrl+n – finds next
Previous
– Find upwards (back) in the source from your current cursor position
All
– Finds all lines within the source
– Additionally will exclude or filter all source not matching your Find string
Provides an intermediate set of lines to AND your search with
– Press Ctrl+W to "show all" excluded lines …and/or to close the find dialog box
– Clicking anywhere in the main body of your source file also closes the Find dialog
– Click the pluses in the left-hand border to show filtered source
Replace
– Adheres to COBOL columns
– If replace would push text past column 73 you will receive a warning
Replace all
– Changes "found" to replacement of values throughout file
Process:
• Perform an initial Find … ALL
• Find any other string:
• Press Next or Previous
(not All)
40
Find/Replace Dialog – 4 of 4 – Find Dialog Preferences
From: Window >
Preferences >
LPEX Editor >
Find Text
41
Regular Expressions in Ctrl+F (Find)
Open WARDRPT.cbl
Press Ctrl+F
To open the Find/Replace dialog
Click: All
Note that the single pipe separator | is a logical "OR" operator
Technique steps:
From the starting point (a variable):
1. Select the field and search (using Occurrences in
Compilation Unit) for all instances of the field throughout
the source code
46
Occurrences in Compilation Unit – continued
You can use Occurrences in Compilation Unit effectively to investigate data movement, analyze the impact of a
change, research the cause of a data-specific ABEND (like an 0C7 or 0C4), etc.
Here's an example showing Search on a variable, with the Search Results view moved, and "pinned" with
additional searches for Occurrences in Compilation Unit exposed through RDz
47
Concept – Pin the Occurrences in Compilation Unit - Search Results
Open a program in the editor
From the command line, type: F <variable-name> and press <Enter>
1. In the Editor source, Double-click (to select) <variable-name>
2. From the Context Menu, select Occurrences in Compilation Unit
This will launch a search for the variable throughout your program, and saves the search
results in a Search Results view
3. From the Search View, click: Pin the Search View – This persists your results view, even when
you launch additional searches
48
Concept – Create a Data Analysis "Dashboard“ From Multiple Search Results
You can move (Drag & Drop)
the Search results views to
different Workbench areas
49
Review - Data Flow Analysis – Using Ctrl+F Regular Expressions
You can do Data Flow Analysis using:
• Ctrl+F
50
Show Expanded Source – RDz v9.1.1 and higher analysis feature
Expands all COBOL Copybooks and PL/I Include statements inline (within) the program source. And it opens the
expanded source file in Browse mode. This can simplify full-program-text analysis.
Note that EXEC SQL INCLUDE xxxx statements are not expanded (although Open Copy member works with these statements)
Expanded source
Program in edit
51
Data Flow Analysis – Review
Data Flow analysis is an iterative complex process, that involves
expanding the scope of your search as new variables in the data flow are
discovered
There are static analysis tools from IBM that are dedicated to providing
this information, through ultra-quick and simple techniques
(ask your instructor about Rational Asset Analyzer)
52
Optional Topics and Workshops For This Section
If you have time, and are comfortable with the material just
covered, feel free to read through the Optional Topic slides –
and/or try out the techniques shown using RDz and the sample
programs.
53
Optional Topic – Using Regular Expressions to Search for Hex Values
You can use regular expressions to search for EBCDIC Hexadecimal Values,
embedded in a program or in copybook source:
Regular Expressions are an ASCII search mechanism
Use ASCII/EBCDIC comparison charts to map to the EBCDIC value you're
looking for
ASCII - 1a
EBCDIC - 3f
ASCII
EBCDIC
55
Optional Topic – Regular Expressions to search for "any hex chars in a file"
You can use Regular Expressions to find any EBCDIC (hex) data in source files:
Regular Expression
Type this in the Find area: [\x00-\x1F]
57
Finding Related Text on Adjacent Lines
Sometimes what you're looking for is broken across adjacent
lines. Example: Find MOVE and a specific variable when the variable is not
on the same line as the MOVE verb
The pattern for search across lines is
ABC[\s\S]*?DEF
Try this:
Open TRTMNT.cbl
From the Search menu
Select: Search…
Enter: move[\s\S]*?actual-val
Enter: TRTMNT.cbl in the
File name patterns edit box
Press Search
58
Regular Expressions – Used to Support ISPF Find "Picture Strings"
ISPF Editor LPEX Editor . Dot, any single
Simple String Y character
Previous String Find Previous / F5
Delimited String Y
^ logical NOT \ special Expression
Text string Y
Picture Strings – special characters Y – with regular expressions
\x Hexadecimal
P'=' – any character Ctlr+F, Regular Expression, .
P'-' – any non-blank character Ctlr+F, Regular Expression, [^\x20]
P'.' – any non-displayable character Ctlr+F, Regular Expression, [^\x20-\x7E]
P'#' – any numeric character Ctlr+F, Regular Expression, [0-9]
P'-' – any non-numeric character Ctlr+F, Regular Expression, [^0-9\x20]
P'@' – any alphabetic character Ctlr+F, Regular Expression, [A-Za-z]
P'<' – any lower-case character Ctlr+F, Regular Expression, [a-z]
P'>' any upper-case alphabetic character Ctlr+F, Regular Expression, [A-Z]
P'$' – any special character (not alphanumeric) Ctlr+F, Regular Expression, [^A-Za-z0-9]
Ctrl+F
59
(Optional Topic) Find/Replace Dialog – Regular Expressions
The Regular Expression meta-language is based on a few simple constructs
60
Find/Replace With Regular Expressions
Expression
Load test1.cbl into the editor
Check Regular expression
Enter the following Regular expressions, and click All after each:
Expression What it does
[0-9] All numeric characters
[a-z] All alphabetic characters
[a-z] Check: Case sensitive in the dialog, and reissue this regular expression.
Then un-check Case sensitive before continuing
DL.C Find all variables with "DL" – any character – then the letter C
[^\s] Find all characters except for white space (blanks: \s )
[^a-z] Non-alphabetic characters
[^A-Z\x20] Non-alphabetic characters and no white spaces
[^A-Z0-9\x20] Non-alphanumeric characters and no white spaces
[^A-Z0-9\x20-] Non-alphanumeric characters, no white spaces, no dashes
[^A-Z0-9\x20\(\)..-] Non-alphanumeric characters, no parenthesis and no white spaces
[^*A-Z0-9\x20\(\)..-] Non-alphanumeric characters, no parenthesis, no asterisks, no white spaces
.*(data) Find all variables that end in "data"
PIC .9|PIC 9\( Find all numeric variable declarations
61
See Notes
Optional Topic – Another Useful Search
Mechanism – Persist Find Results
Using the Search menu, you can
search on a variable (or any partial
selected text) in a program with:
Search
Text > File
The results persist and are hyperlinked – for
easy navigation, and can be:
Copied/pasted to a requirements document
Changed
Replace Selected…
Replace All…
Searched Again
to provide the
capability of
AND-ing
multiple search
patterns
62
Optional Topic – Highlight Found Text
63
ISPF - Find All (Exclude) Search Within File
Common ISPF editing technique:
- Exclude various source lines
- find (within) excluded lines
- Used extensively on giant
production source files
Note that you can create a custom "User Key Action" – for filterSelection – so that ONLY is
more closely emulated.
Preferences > LPEX Editor > User Key Actions
Define a custom Key for filterSelection
In this example, Alt+F9 (a-f9) is set to: filterSelection
66
Another Example of Text Filtering – Selected > Filter selection
Double-click to select a:
COBOL Keyword
Literal
Variable
Label (Paragraph or Section name)
Right-Click
Selected
Filter selection
Note the plus signs Expand/Collapse filtered code
Press Ctrl/W to un-filter and return to
normal program view
67
Show In > Data Elements
68
Sorting the Data Elements view
Can sort/re-sort by any column in the view
Useful for:
• Categorizing variables sort by Declared In
• Organizing by COBOL Group sort by Top-Level Item
• Sorting by numeric …vs… character data sort by Declaration
• Business Rules candidates sort by References
69
Finding unused variables
To find unused variables in a program
1. Filter the View (small downward pointing triangle)
Hide program labels
2. Sort by References (lowest to highest) – zero references are your candidate unused list
3. Look at the Declared In column – candidates for removal are declared in your .cbl program
4. Look at the Item type – for Data items (not indexes)
5. Look at the Level – Level 1 are Group fields, that will need further examination
6. When in doubt, right-click the variable and select: Occurrences in Compilation Unit for a detailed view of field usage
70
Filtering the Data Elements view
Filter view results horizontally
search by data element name
or text pattern
Filter out or add back into the view results paragraphs and sections, and FILLER ("unnamed items")
by clicking the small downward-pointing triangle on the far-right corner of the view
71
Topic Summary
After having completed this topic, you should now be able to:
Search through your source files on z/OS
Use Regular Expressions for complex search requirements
Filter search results – for AND'd search requirements
Understand the difference between Index and regular (TSO) search
Export Index search results to an external format
72
Backup Slides
73
RSE Component Overview
Source: "Developer for System z & WLM", Onno Van Den Troost
See slide notes…
74
See Notes