Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SRCHFOR to search a string at a particular position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SRCHFOR to search a string at a particular position
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Nov 11, 2009 2:08 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Nov 11, 2009 2:46 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us