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
 

 

Search a string within a PDS
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Fri Apr 08, 2005 12:02 am    Post subject: Search a string within a PDS
Reply with quote

I need to search a string within a PDS. This PDS have some of PS files as members. All the PS having data. I need to search in these data.
Please advise me. Please don't advise using ISPF -->3.14.
Back to top
View user's profile Send private message

ranjit_bh

New User


Joined: 06 Apr 2005
Posts: 7

PostPosted: Fri Apr 08, 2005 8:22 am    Post subject: Re: Search a string within a PDS
Reply with quote

Hi Vinit,
If you could provide more details about the requirement it might be useful. You could also mention why you do not wish to use the 3.14/3.15 ISPF search utility.

Regards,
Ranjit
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Fri Apr 08, 2005 3:12 pm    Post subject:
Reply with quote

vinit,

You can write a scan jcl and search a string in the PDS.
Back to top
View user's profile Send private message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Fri Apr 08, 2005 3:56 pm    Post subject:
Reply with quote

hi,

In TSO , go to the option K [ PDS and Library Management Tools-> PDSMAN].

PDSMAN provides facility to process the members of a PDS. It can be either
1. Searching for a string in members of a PDS
2. Scaning for a string and replacing it with another string in all members of that PDS.

Follow the steps
=============================================
1. Select the option 7 [Member Scan/Replace Utility] from the screen you get after going to PDSMAN option.

2.Give the PDS name, select the option either S (scan) or R(replace).

3. Select either the foreground or batchground procees. Give "*" in sysout field.

4. Press enter, if you want to process all the members of the PDS , then keep blank for "member" field and press enter in the next screen you get.

5. Give the string name you want to search

6. for replace operation, you have to give both the string to be replaced and a string to be replaced with.

7. you also have filtering facility here to narrow down your search output.

8.press enter

9. If it is a foreground operation you have selected int the first screen, then you will get the details on the members that have satisfied the condition you have specified immediately on the screen.

10. If you have selected batch mode, then a jcl will be created and submitted. one advantage here is you can save the output of your search criteria in a data set. If you don't want this , you can just specify foregroung mode of operation.

========================================

please tell us , why you don't want to use 3.14 option of TSO for the same purpose.

Thank you
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Fri Apr 08, 2005 6:40 pm    Post subject: Re: Search a string within a PDS
Reply with quote

Hi Ranjit,

Actually i want to see the JCL for this. Also as ii know by 3.14 we can only search in one member. But i want to do for multiple members once.


Regards,
Vinit
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Fri Apr 08, 2005 7:02 pm    Post subject:
Reply with quote

Vinit
you can serach all the members in a PDS at once. You don't have to search each members one by one. Use the wild card '*'
for the member name.
Like YOUR.PDS(*) as the search library. This will search all the members in the PDS. Also you have the option to search Foreground and Background.So you can select the Background option and create a job for this.
Here is a sample job for your refernce.
Code:

//SEARCH  EXEC PGM=ISRSUPC,                                           *
//            PARM=(SRCHCMP,                                           
//            '')                                                     
//NEWDD  DD DSN=YOUR.DATASET1,                                     
//          DISP=SHR                                                   
//       DD DSN=YOUR.DATASET2,                                     
//          DISP=SHR                                                   
//OUTDD  DD SYSOUT=(*)                                                 
//SYSIN  DD *                                                         
SRCHFOR  'your search string'
/*   


hth
-Som
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Fri Apr 08, 2005 7:22 pm    Post subject:
Reply with quote

Thanks Som.
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Tue Apr 26, 2005 7:18 pm    Post subject:
Reply with quote

Dear Vnit,

You can use file-aid option 3.6 to do the search.

It is much simple and faster too....

Hope iam right. If anything wrong please make a note.

Thanks,
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Tue Apr 26, 2005 11:23 pm    Post subject:
Reply with quote

Hi Guys,
As posted by somsundar above, i also have a similar requirement:
I need to find a string like '123456' in a single dataset
Code:
=============================
//SEARCH  EXEC PGM=ISRSUPC,                                           
//            PARM=(SRCHCMP,                                           
//            ' ')                                                     
//NEWDD  DD DSN=YOUR.DATASET1,                                     
//                 DISP=SHR                                                   
//OUTDD  DD SYSOUT=(*)                                                 
//SYSIN    D *                                                         
SRCHFOR  '123456'
/*   
=============================

Will the above piece of code serve my purpose?
Also, i wud really appreciate if any1 throws light on the utility "ISRSUPC" and its parameters, this is very new to me.

Thanks in advance,
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Apr 26, 2005 11:37 pm    Post subject: Re: Search a string within a PDS
Reply with quote

The SuperC program is documented in the ISPF User's Guide:

http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ispus200/APPENDIX1.1?DT=20000714183705
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Thu Apr 28, 2005 9:29 pm    Post subject:
Reply with quote

Hey superk,
What is exactly want is :

In a job
1. Search for the string in the Variable Block dataset.
2. If found execute the next step in job.
3. If not found terminate the job.

For instance:
========ANDYCOOL.TEST.DATA========
165780078203043
290780078203043
===============================
From the above dataset which is a Variable Block dataset, i need to find if any record starts with '165', If yes the next step in the job shud be executed else the job shud terminate.

I guess i can do this by the SORT utility. Below is a code which will copy the selected record to some other dataset, i need to know how shud i modify it to meet my above mentioned requirements.
/*
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,3,CH,EQ,C'165')
/*

Please let me know, Thanks in advance,
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Apr 28, 2005 11:40 pm    Post subject: Re: Search a string within a PDS
Reply with quote

This should work:
Code:

//STEP0001 EXEC PGM=ICETOOL                             
//TOOLMSG  DD   SYSOUT=*                               
//DFSMSG   DD   SYSOUT=*                               
//IN       DD   DSN=input.dataset ...
//T1       DD   DSN=&&T1,DISP=(NEW,PASS),UNIT=VIO       
//TOOLIN   DD   DATA                                   
  COPY FROM(IN) USING(CTL1)                             
  COUNT FROM(T1) EMPTY                                 
/*                                                     
//CTL1CNTL DD   DATA                                   
  INCLUDE COND=(5,3,CH,EQ,C'165')                       
  OUTFIL FNAMES=T1                                     
/*                                                     
//*                                                     
// IF (STEP0001.RC = 0) THEN    <== DATA FOUND
//STEP0002 EXEC PGM=whatever
// ENDIF                                               
//*                                                     
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Fri Apr 29, 2005 9:58 pm    Post subject:
Reply with quote

yeah...it worked ,

Thanks SuperK
Regards
Back to top
View user's profile Send private message
lokeshmaremalla

New User


Joined: 13 Sep 2006
Posts: 2

PostPosted: Thu Oct 05, 2006 9:10 pm    Post subject: How to find a string with regular expressions
Reply with quote

Hi,

In the below example how can i insert the regular expressions in 'your search string'.

Code:
//SEARCH  EXEC PGM=ISRSUPC,                             
//            PARM=(SRCHCMP,                                           
//            '')                                                     
//NEWDD  DD DSN=YOUR.DATASET1,                                     
//          DISP=SHR                                                   
//       DD DSN=YOUR.DATASET2,                                     
//          DISP=SHR                                                   
//OUTDD  DD SYSOUT=(*)                                                 
//SYSIN  DD *                                                         
SRCHFOR  'your search string'
/*


Thnaks in advance,
Lokesh
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Oct 05, 2006 10:29 pm    Post subject:
Reply with quote

Hi there,

U can also use fairscan for this.
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Fri Oct 06, 2006 10:08 am    Post subject:
Reply with quote

Hi,

You can also use PDSMAN EZYedit to search a string in a PDS.

Enjoy,
Neelesh
Back to top
View user's profile Send private message
lokeshmaremalla

New User


Joined: 13 Sep 2006
Posts: 2

PostPosted: Fri Oct 06, 2006 7:12 pm    Post subject: Re: Search a string within a PDS
Reply with quote

Hi,

Could any one please give me a program to find a string in PDS with regular expression.

Here is my regular expression to search a string.
"^abc"
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Thu Jan 04, 2007 1:27 pm    Post subject: Re: Search a string within a PDS
Reply with quote

HI ALL,

IN MY CASE TSO OPTION K WAS NOT AVAILABLE?

how to replace a string in all the pds members
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Wed Nov 07, 2007 1:54 pm    Post subject:
Reply with quote

Can i have the above Jcl updated for the Complete search update option.
ie. searchfor 'string' replace by 'new string' ?
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Wed Nov 07, 2007 2:01 pm    Post subject:
Reply with quote

Another way to find a string in the members of PDS is:

in command line type:--> SRCHFOR "STRING NAME"
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


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