searching a string in members of a pds via rexx
Moderators: Veera, Moderator Group
searching a string in members of a pds via rexx
Hi..I am new to the forum.Can anyone guide me to get a code in rexx that would search for a string in members of a pds and write the results (not the member name but the line where it occured along with member name) in a seperate ps.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
look in the rexx reference for the example ISRMBRS macro.
you need to 'PUT' your target (search string) to the variable pool,
then you MACRO (see isrmbrs) can 'GET' the string and perform FINDs.
each find will provide you with the line number (isredit edit macro LINENUM)
and the isredit edit macro member will tell you the member name.
REXX Reference
EDIT and EDIT MACROS
you need to 'PUT' your target (search string) to the variable pool,
then you MACRO (see isrmbrs) can 'GET' the string and perform FINDs.
each find will provide you with the line number (isredit edit macro LINENUM)
and the isredit edit macro member will tell you the member name.
REXX Reference
EDIT and EDIT MACROS
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
then invoke superc with your rexx scripts after allocating the files necessary,
then parse the ouptut.
and yes, it will probably take more that 12 minutes to understand the concepts of invoking a pds member in VIEW with an initial edit macro.
the only advantage to learning this is then you could use it when you wanted to make global changes to a PDS and the other utilities are not built for the task.
i.e. replacing one or more lines with more than one line.
sorry about the get and put, should have been VGET and VPUT which are explained here.
short of actually exerting any effort on your part,
you could submit (or interactive) a search, using the parm IDPFX, which will print the member name on the left side of each hit displayed.
that way you have all the info you need in the superc output.
then parse the ouptut.
and yes, it will probably take more that 12 minutes to understand the concepts of invoking a pds member in VIEW with an initial edit macro.
the only advantage to learning this is then you could use it when you wanted to make global changes to a PDS and the other utilities are not built for the task.
i.e. replacing one or more lines with more than one line.
sorry about the get and put, should have been VGET and VPUT which are explained here.
short of actually exerting any effort on your part,
you could submit (or interactive) a search, using the parm IDPFX, which will print the member name on the left side of each hit displayed.
Code: Select all
ISRSUPC - MVS/PDF FILE/L
MEMBER LINE-# SOURCE LINE
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-
- Member
- Posts: 8
- Joined: Wed Jan 25, 2012 6:55 pm
Hi Sagar,
I hope the following way wil give solution ( if i untersatnd correctly)
1. Provide PDS name and Search string
2. Using ListDS command get all the members under that PDS.
3. Read each meber data using EXECIO read operation.
4. search for the word in the line.
5. If finds , write the line content and the PDS member name in a PS file.
Hope this is useful...
I hope the following way wil give solution ( if i untersatnd correctly)
1. Provide PDS name and Search string
2. Using ListDS command get all the members under that PDS.
3. Read each meber data using EXECIO read operation.
4. search for the word in the line.
5. If finds , write the line content and the PDS member name in a PS file.
Hope this is useful...
Gaining Knowledge
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page