Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy one PDS to another PDS based on search creteria

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy one PDS to another PDS based on search creteria
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: 1738
Location: Bloomington, IL

PostPosted: Tue Sep 29, 2015 9:41 pm    Post subject:
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

New User


Joined: 01 Sep 2015
Posts: 94
Location: Switzerland

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

I strongly suggest the PDS86 program from www.cbttape.org , 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

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Wed Sep 30, 2015 12:07 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Sep 30, 2015 1:40 pm    Post subject: Reply to: Copy one PDS to another PDS based on search creteria
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Sep 30, 2015 1:56 pm    Post subject: Reply to: Copy one PDS to another PDS based on search creteria
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Wed Sep 30, 2015 2:23 pm    Post subject:
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    Post subject: Reply to: Copy one PDS to another PDS based on search creteria
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: 645
Location: Pennsylvania

PostPosted: Wed Sep 30, 2015 6:13 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Sep 30, 2015 6:42 pm    Post subject: Reply to: Copy one PDS to another PDS based on search creteria
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    Post subject: Reply to: Copy one PDS to another PDS based on search creteria
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us