View previous topic :: View next topic
|
Author |
Message |
alluri12
New User
Joined: 15 Aug 2006 Posts: 44 Location: Virginia, USA
|
|
|
|
I have around 5000 members in a PDS and need to copy only members to another PDS that meet the search creteria.
For example
copy only members that has "TTTTT" in it. Doesn't matter the position.
Could you please help me get thru this. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Use ISPF Edit in batch. Search for the string using the FIND command; if it found, use CREATE to copy the member to the new PDS. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
And what's wrong specifying *TTTTT* as member name on 3.3 and doing a "S *" on the selection panel? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Depends what "in it" means :-)
Member name? Or member content? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
copy only members that has "TTTTT" in it. Doesn't matter the position. |
since the TS cited search I vote for content |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
TSO option 3.14 to do the content search to identify members with that string and then member copy based on that output perhaps? |
|
Back to top |
|
|
alluri12
New User
Joined: 15 Aug 2006 Posts: 44 Location: Virginia, USA
|
|
|
|
Sorry for not being little more clear.
'TTTTT' is the content in the member.
Going into 3.14 and doing search and copying member is lot of manual work.
I am looking for a batch jcl to automate this.
This is a part of daily process that we do. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
You can automate this in three easy steps:
1) Run your search in batch like shown here. Be sure to write your output to a dataset to be used in step 2. Also make note of the parms I have used. This will put the member name on the same line as the searchfor data.
Code: |
//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,
// 'ANYC IDPFX')
//NEWDD DD DSN=MY.INPUT.PDS,
// DISP=SHR
//*
//OUTDD DD DSN=MY.WORK.DATASET,
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,
// DCB=(BLKSIZE=0,LRECL=133,RECFM=VBA),
// SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
SRCHFOR 'TTTTT'
/* |
2) Use the sort product of your choice. You will need the following:
INCLUDE statement to include only your TTTTT from file:
Code: |
INCLUDE COND=((20,100,SS,EQ,C' TTTTT ') |
SORT and SUM statements to remove duplicate occurances within the same member:
Code: |
SORT FIELDS=(2,8,CH,A)
SUM FIELDS=NONE |
OUTFIL BUILD statements to format output to create IEBCOPY input cards to be used in next step.
3) IEBCOPY step using cards created in step above. I will leave the details up to you. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
A variation of daveporcelan's. Have a look at the ISRSUPC "Process options". You will find LMTO, which will modify the output listing to list all the members that a search was successful within (LNFMTO instead would list those where the search was not successful).
Send the output to a dataset, filter and format for IEBCOPY with SORT. |
|
Back to top |
|
|
alluri12
New User
Joined: 15 Aug 2006 Posts: 44 Location: Virginia, USA
|
|
|
|
Thanks everybody who contributed. I am able to get thru this. Here is the jcl i used to get thru this.
Three steps i used
1. Searches for the string and writes into the dataset
2. Sorts /format and copies into output dataset that will be used by IEBCOPY.
3. Copies the pds into another pds dataset.
Code: |
[code]//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'LMTO')
//NEWDD DD DSN=Input_dataset,
// DISP=SHR
//OUTDD DD DSN=Output.temp1,
// DISP=(NEW,CATLG,DELETE),
// AVGREC=K,
// SPACE=(133,(5,5)),
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB)
//SYSIN DD *
SRCHFOR 'TTTTT'
/*
//STEP02 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=Output.temp1
//SORTOUT DD DISP=SHR,DSN=Output.temp2
//SYSIN DD *
SORT FIELDS=COPY -
INCLUDE COND=(30,6,CH,EQ,C' 2 ') -
OUTREC FIELDS=(3:X,C'SELECT MEMBER=',2,9,80:X)
/*
//STEP010I EXEC PGM=IEBCOPY
//VAMBYPAS DD DUMMY
//SYSPRINT DD SYSOUT=*
//INP0 DD DISP=SHR,DSN=Input.dataset
//OUT0 DD DISP=SHR,DSN=Final.output.dataset
//SYSIN DD DISP=SHR,DSN=Parmlib.dataset(IEBCOPY1)
// DD DISP=SHR,DSN=Output.temp2[/code]
[code]parmlib.dataset(IEBCOPY1) has COPY OUTDD=OUT0,INDD=((INP0,R))
output.temp2 has SELECT MEMBER=LCXXXXX0
SELECT MEMBER=LCXXXXX1
SELECT MEMBER=LCXXXXX2
SELECT MEMBER=LCXXXXX3
SELECT MEMBER=LCXXXXX4[/code]
|
|
|
Back to top |
|
|
|