Greetings All,
I have planned to create a tool which would help me to find out the 'value' in a set of files. I will explain my thought below followed by my query,
For ex,
I have designed a panel using which user would input ID and Name. In my logic if ID is 100, then i have given
data51 = Filename1
data52 = Filename2
data53 = Filename3
data54 = Filename4
"ISREDIT SRCHFOR 'Name.1'"
I have inputted 'Sharmi' as name and this value should be searched in those 4 files. If that value is found in any of those files, then that file name should be captured in a variable. And my logic continues, if it is not found in those 4 files, it will search in
BUSfl = Filename5
"ISREDIT SRCHFOR 'Name.1'"
And, if found here this filename will be captured.
When i displayed RC after the ISREDIT SRCHFOR command, it showed 20 even if the name exists in those files or not.
Please Guide me how to know if the name exists or not and also to capture the found file name.
Note: It will be found only in one of those first 4 files. If not found in those, it will be in filename5.
Thank you all in advance.
Search for a string in a set of PS files
Moderators: Veera, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Hi Collins,
There are no errror messages, i instructed it to display RC, so it showed 20.
I have posted my rough code below,
TRACE ON
"ISREDIT MACRO"
x=msg("off")
ADDRESS "ISPEXEC"
"LIBDEF ISPPLIB DATASET ID('USERID.REXX.LIB')"
"DISPLAY PANEL(GETPNL)"
/* Get input values from the user*/
"VGET (REGN,ORG1,ORG2,ORG3,ORG4,ORG5,ORG6,ORG7,ORG8,ORG9,CARD1,CARD2,
CARD3,CARD4,CARD5,CARD6,CARD7,CARD8,CARD9) SHARED"
if rc=0 then
org.1 = org1
org.2 = org2
org.3 = org3
org.4 = org4
org.5 = org5
org.6 = org6
org.7 = org7
org.8 = org8
org.9 = org9
card.1 = card1
card.2 = card2
card.3 = card3
card.4 = card4
card.5 = card5
card.6 = card6
card.7 = card7
card.8 = card8
card.9 = card9
i=1
j=1
card = 'N'
do until card = 'Y'
if org.i = '100' then
data51 = filename1
data52 = filename2
data53 = filename3
data54 = filename4
"ISREDIT SRCHFOR 'card.i'"
say rc
exit
if rc=0 then
card = 'Y'
else
BUSfl = filename5
"ISREDIT SRCHFOR 'card.i'"
if rc=0 then
card = 'Y'
And it goes on checking the other files. Here after displaying RC i have given exit comman, since the code goes in loop.
Hope this gives some clarity.
Thanks in advance.
There are no errror messages, i instructed it to display RC, so it showed 20.
I have posted my rough code below,
TRACE ON
"ISREDIT MACRO"
x=msg("off")
ADDRESS "ISPEXEC"
"LIBDEF ISPPLIB DATASET ID('USERID.REXX.LIB')"
"DISPLAY PANEL(GETPNL)"
/* Get input values from the user*/
"VGET (REGN,ORG1,ORG2,ORG3,ORG4,ORG5,ORG6,ORG7,ORG8,ORG9,CARD1,CARD2,
CARD3,CARD4,CARD5,CARD6,CARD7,CARD8,CARD9) SHARED"
if rc=0 then
org.1 = org1
org.2 = org2
org.3 = org3
org.4 = org4
org.5 = org5
org.6 = org6
org.7 = org7
org.8 = org8
org.9 = org9
card.1 = card1
card.2 = card2
card.3 = card3
card.4 = card4
card.5 = card5
card.6 = card6
card.7 = card7
card.8 = card8
card.9 = card9
i=1
j=1
card = 'N'
do until card = 'Y'
if org.i = '100' then
data51 = filename1
data52 = filename2
data53 = filename3
data54 = filename4
"ISREDIT SRCHFOR 'card.i'"
say rc
exit
if rc=0 then
card = 'Y'
else
BUSfl = filename5
"ISREDIT SRCHFOR 'card.i'"
if rc=0 then
card = 'Y'
And it goes on checking the other files. Here after displaying RC i have given exit comman, since the code goes in loop.
Hope this gives some clarity.
Thanks in advance.
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