IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SRCHFOR to search a string at a particular position


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Tue Nov 10, 2009 5:43 pm
Reply with quote

Actually i want to search a string at a particular position of the members in the PDS. does the SRCHFOR command be given for search along with a condition

Code:
INCLUDE COND(1,6,EQ,C'STRING')


Does this suffice icon_exclaim.gif icon_exclaim.gif
Back to top
View user's profile Send private message
Kumar Saraboji

New User


Joined: 15 Sep 2009
Posts: 8
Location: India

PostPosted: Tue Nov 10, 2009 6:10 pm
Reply with quote

Hi,

If I have understood your requirement, please find below for the answer to the first part of your query.

SRCHFOR 'STRING' 1:6

I didnt get your second part - condition??
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Nov 10, 2009 6:12 pm
Reply with quote

You can try this.

Code:
//SEARCH  EXEC PGM=ISRSUPC,
//            PARM=(SRCHCMP,
//            '')
//NEWDD  DD DSN=YOUR.PDS,DISP=SHR
//OUTDD  DD SYSOUT=*
//SYSIN  DD *
SRCHFOR  'STRING'
CMPCOLM 1:6
/*
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Tue Nov 10, 2009 6:16 pm
Reply with quote

Code:
SRCHFOR  'ABC',4:40     Finds string "ABC" if it starts in column 4 -> 40


If we use CMPCOLM,
Code:
CMPCOLM,  Compare Columns.  Searches only the columns to be searched from each source line.
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Nov 11, 2009 9:11 am
Reply with quote

Thanks for your help icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Nov 11, 2009 9:32 am
Reply with quote

If the SRCHFOR is to be run in a loop untill all the members in a PDS are done icon_question.gif icon_question.gif icon_question.gif


Help me out in the looping ...can we go with the steps like STEP01
STEP02....??????????
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Nov 11, 2009 11:42 am
Reply with quote

Have you tried the above job? It will search all the members of the PDS.
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Nov 11, 2009 2:04 pm
Reply with quote

sorry i dint try it ok i will try it and let u know thanks in advance icon_idea.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 11, 2009 2:08 pm
Reply with quote

tecnokrat wrote:
sorry i dint try it ok i will try it and let u know thanks in advance icon_idea.gif

Then DO NOT ask questions which would have been answered if you had bothered to have gotten off your butt and actually tested it icon_evil.gif
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Nov 11, 2009 2:35 pm
Reply with quote

Thanks srihari.

I got the required output.

My second condition is to individually take the count of the members for that particular string.
Code:
 SRCHFOR 'STRING1'
              CMPCOLM 1:6
               COUNT =COUNT + 1
       

and also i need to have an and query like
Code:
SRCHFOR 'STRING1'
             CMPCOLM 1:6
            AND SRCHFOR 'STRING2'
                    CMPCOLM 1:6

will this be able to acheive my requirement ?????
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 11, 2009 2:46 pm
Reply with quote

Take a look at the LMTO & XREF process options.

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top