View previous topic :: View next topic
|
Author |
Message |
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
I want to search name of the members in PDS. I don't want to search contents. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
Sorry, expat
I don't know rexx. I require JCL for this. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
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 |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
VIKAS GAIKWAD
New User
Joined: 30 Nov 2006 Posts: 33 Location: MUMBAI
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|