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

Copy one PDS to another PDS based on search creteria


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Tue Sep 29, 2015 8:10 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Sep 29, 2015 9:41 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Sep 30, 2015 1:52 am
Reply with quote

I strongly suggest the PDS86 program from Use [URL] BBCode for External Links , look for file 182. It is awesome and does almost everything with and for pds.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Sep 30, 2015 12:07 pm
Reply with quote

And what's wrong specifying *TTTTT* as member name on 3.3 and doing a "S *" on the selection panel?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 30, 2015 1:40 pm
Reply with quote

Depends what "in it" means :-)

Member name? Or member content?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 30, 2015 1:56 pm
Reply with quote

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
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Wed Sep 30, 2015 2:23 pm
Reply with quote

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
View user's profile Send private message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Wed Sep 30, 2015 5:15 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Sep 30, 2015 6:13 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Sep 30, 2015 6:42 pm
Reply with quote

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
View user's profile Send private message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Thu Oct 01, 2015 2:33 am
Reply with quote

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

 


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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top