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

How to search a member in PDS


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Mon Mar 26, 2007 7:28 pm
Reply with quote

How to search a member in PDS?

I have got around 100 members, which needs to be search in PDS having members more than 6000.

Which is JCL utility provided for this & let me know the Syantax for the same.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 26, 2007 7:32 pm
Reply with quote

Quote:
How to search a member in PDS?

Do you mean that you want to search for the name of a member in a PDS, or that you want to search the contents of a member for a given string ?
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Mon Mar 26, 2007 7:41 pm
Reply with quote

I want to search name of the members in PDS. I don't want to search contents.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 26, 2007 7:45 pm
Reply with quote

LISTPDS as shown in the Utilities manual will give you the contents of a PDS. You can then possibly process the output from this via REXX to tell you what you want.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Mon Mar 26, 2007 7:48 pm
Reply with quote

Sorry, expat

I don't know rexx. I require JCL for this.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 26, 2007 7:54 pm
Reply with quote

LISTPDS will list out the members in a given PDS.

I suggested the REXX as a faster than eye scan to see which PDS contains the members you want to find. ALthough the members are listed alphbetically.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Mar 26, 2007 8:13 pm
Reply with quote

All of these previous posts deal with finding member names of a PDS:

ibmmainframes.com/viewtopic.php?t=235
ibmmainframes.com/viewtopic.php?t=9831
ibmmainframes.com/viewtopic.php?t=13908
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Tue Mar 27, 2007 5:59 pm
Reply with quote

Hi superK,

I tried out all the links you provided. But, No one satisfies me.

I already mentioned that, I have got around 100 members(which are in one ps say ABC), which needs to be search in PDS(say XYZ) having members more than 6000.

ex.The contents of ps is like

abc
xyz
lmn
opr
zjk

The members of PDS is like

a12
aqw
abc
xxx
xyz.

Now the result I require is in another PS whose contents as follows
abc
xyz


Which is JCL utility provided for this & let me know the Syntax for the same.

I tried out

//STEP10 EXEC PGM=IKJEFT01
//SYSTSPRT DD DSN=YOUR PDS MEM LISTING
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD *
LISTDS 'your pds name'
MEMBERS(
abc)
/*

No desired output.

//STEPXXXX EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=MY.PDS
//SYSUT2 DD DSN=MY.SEQ,DISP=(,CATLG,DELETE),...
//SYSIN DD *
PUNCH TYPORG=PO
/*

It ran successfully, But I want only names of members which are exactly same in both ABC(ps) & in XYZ(PDS). Above JOB gives all contents.


Again I tried for following.

//STEPXXXX EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=MY.PDS
//SYSUT2 DD DSN=MY.SEQ,DISP=(,CATLG,DELETE),...
//SYSIN DD *
PUNCH TYPORG=PO,MAXNAME=N
MEMBER NAME=member1
MEMBER NAME=member2
...............
...............
MEMBER NAME=memberN

/*


Which gives MAXCC12. I think due to syntax.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Mar 27, 2007 6:04 pm
Reply with quote

As I said earlier, you will need to produce some type of logic to cross reference which members are in the PDS.

You can use the output from LISTPDS and the PS file.

REXX will be able to do this for you, and so will DFSORT. Look at the SORT forum, using the SPLICE command may be of a great help to you. In fact - it is exactly what you want.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Tue Apr 03, 2007 4:10 pm
Reply with quote

Quote:
Again I tried for following.

//STEPXXXX EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=MY.PDS
//SYSUT2 DD DSN=MY.SEQ,DISP=(,CATLG,DELETE),...
//SYSIN DD *
PUNCH TYPORG=PO,MAXNAME=N
MEMBER NAME=member1
MEMBER NAME=member2
...............
...............
MEMBER NAME=member


For above syntax the lines


PUNCH TYPORG=PO,MAXNAME=N
MEMBER NAME=member1
MEMBER NAME=member2
...............
...............
MEMBER NAME=member

it is better to after 8th column, otherwise it gives maxc 12.

Then use SORT on output file to get result.
Thanks SuperK.

You can use sort parameters like following

SORT FIELDS=COPY
INCLUDE COND=(1,7,CH,EQ,C'VMEMBER')
INREC FIELDS=(1:15,8)


Thanks,

Vikas
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Tue Apr 03, 2007 4:34 pm
Reply with quote

Also for PUNCH TYPORG=PO,MAXNAME=N

MAXNAME=you can give value 1000 or 2000 or anything. But must be greater than number of members you are finding.



Thanks,

Vikas
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 03, 2007 7:49 pm
Reply with quote

Hello,

You have a ps file with the member names you are interested in - that will be input 1. Create another file with all of the member names as recommended above - that will be input 2.

Make sure both files are in member-name order.

Using jcl and control statements, match the 2 files using the sort utility and create the output you want. Examples of what you want are available in the DFSORT forum once you have the 2 usable files.
Back to top
View user's profile Send private message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Tue Apr 03, 2007 8:16 pm
Reply with quote

Hello,

I think solution given by you is Fine & also will take less time.

But then I will face following problem.

Quote:
Create another file with all of the member names as recommended above - that will be input 2.


Suppose I have one PDS having name ABC.XYZ(contaning 5000 members). So copying these member names to another dataset is tedious & second thing is the new mebers in PDS may be added or some may be get deleted after some time.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 03, 2007 8:38 pm
Reply with quote

Hello,

You don't need to do this manually - if you use LISTPDS, you will have your member names file created for you.

The pds will always have the potential to be added to and deleted from. That is just the nature of a pds. I do not believe it relates to matching the "hit" list to the current member names.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
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 first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top