Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Search for a string in a set of PS files

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> TSO, CLIST & REXX
  View previous topic :: View next topic  
Author Message
sharmi
Member


Joined: 17 Jul 2013
Posts: 13

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jul 06, 2015 5:05 pm    Post subject: Search for a string in a set of PS files Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

William Collins
Active Member


Joined: 24 May 2012
Posts: 714

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jul 06, 2015 7:37 pm    Post subject: Reply with quote

Why don't you find out what an RC of 20 means? Have you used Trace?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sharmi
Member


Joined: 17 Jul 2013
Posts: 13

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jul 08, 2015 12:29 pm    Post subject: Reply with quote

Hi Collins,

Thanks for your reply.

Yeah i have used TRACE ON. I am a beginner in REXX so i am trying to find out what RC=20 means in ISREDIT. But couldn't get the exact answer.

Please help me to figure it out.

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 714

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jul 08, 2015 2:42 pm    Post subject: Reply with quote

RC 20 means absolutely no fat chance on earth the thing which caused the 20 could possibly work.

Can you post the output of the trace (copy/paste from your emulator), say 10 liines before the error, the error, and 10 lines after.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sharmi
Member


Joined: 17 Jul 2013
Posts: 13

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jul 10, 2015 10:48 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> TSO, CLIST & REXX All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Query For IEBPTPCH 3 padmajeet.gaikwad 13445 Mon Feb 01, 2016 10:56 pm
academyindia4 View latest post
No new posts Unable to achieve below scenario using ICETOOL 27 sirianangel 33683 Mon Feb 01, 2016 10:01 pm
academyindia4 View latest post
No new posts Need to put records a Sorting order as mentioned below. 14 Yash1911 12634 Mon Jan 25, 2016 9:50 pm
academyindia4 View latest post
No new posts how to deal with the below scenario using iebgener 7 mainframes_6002 11170 Wed Dec 07, 2011 10:34 am
DikDude View latest post
No new posts Coulu someone explain the parameters in the below code? 1 lovely sweety 11352 Thu Jun 09, 2011 3:50 pm
dbzTHEdinosauer View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7895.html