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

Search a string within a PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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: 435
Location: chennai, India

PostPosted: Fri Apr 08, 2005 3:12 pm
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
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
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
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
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
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
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

Global Moderator


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

PostPosted: Tue Apr 26, 2005 11:37 pm
Reply with quote

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

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
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

Global Moderator


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

PostPosted: Thu Apr 28, 2005 11:40 pm
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
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Oct 05, 2006 10:29 pm
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
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
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
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
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
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
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Nov 07, 2007 4:08 pm
Reply with quote

Binaya,

Quote:
in command line type:--> SRCHFOR "STRING NAME"


isn't this command site-specific? the member/PDS name is not specified in the command. is that fine?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Nov 07, 2007 6:19 pm
Reply with quote

Quote:
in command line type:--> SRCHFOR "STRING NAME"

This command is working for me as well..but it just says that in particular member of PDS "string" is present. But how many time in that member, which line is not displayed. If members are enough, then I think not a good information is visible after execution of this command.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Nov 07, 2007 7:54 pm
Reply with quote

Quote:
n command line type:--> SRCHFOR "STRING NAME"


the command is not site specific ...
is ISPF release dependent specific ....

when posting command syntax and results it would be useful
( to avoid useless searches and network traffic )
to post a little bit of info on the environment
at least the ISPF/zOS level
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Nov 07, 2007 8:14 pm
Reply with quote

enrico-sorichetti wrote:
the command is not site specific ...
is ISPF release dependent specific ....


Thanks for the information e-s. After your post, I tried searching about this & got this link on the same topic.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Nov 09, 2007 2:30 pm
Reply with quote

notonly4u wrote:
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,



I need the Jcl for the File-aid option 3.6 to do the search -update.
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 Goto page 1, 2  Next

 


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 Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top