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

Search and Merge selected PDS Members


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

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Sun Jun 16, 2013 1:22 pm
Reply with quote

Hi,
Would need some assistance and directions for the below requirement of mine.

I Have a PDS : ABC.DEF.GHI
It has several members, I need to take all the members which start from a1 and copy into a PS. As in all the "A1* " members in a PDS.

My work
Utility IEBPTPCH helps to copy all members into a PS.
We can also give member names in it. But it does not supports wildcards such as * (asterisk).
Same is the case with IEBCOPY too.

Appreciate your time and help on this.
Let me know, if any other info is required.

Thanks.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Sun Jun 16, 2013 4:58 pm
Reply with quote

You can use IEBCOPY as below:

Code:
//STEP01   EXEC PGM=IEBCOPY,REGION=4M
//SYSUT1    DD DISP=SHR,DSN=IN.PDS
//SYSUT2    DD DISP=SHR,DSN=OUT.PDS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
  COPY     INDD=SYSUT1,OUTDD=SYSUT2
  SELECT   MEMBER=MEM00001,                                            X
               MEM00002,                                               X
               MEM00003,                                               X
               MEM00004,                                               X
               MEM00005 



Note that X in col 72 is to continue the copy control statement and stop at a comma. You can put any nonblank character in column 72 and start in column 16 on the next record.

You can use ISPF commands or REXX or SORT to apply the formatting required to build the control crads for IEBCOPY.

Hope this helps.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jun 17, 2013 12:06 am
Reply with quote

How about copying the required members to a temporary PDS and then using IEBPTPCH or IEBCOPY?

You can easily get the members required:
use a mask in the member name in option 3.3
the S *
and voila - your target members are copied to a PDS all of their own.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Mon Jun 17, 2013 5:38 am
Reply with quote

Thanks Mistah and Nic.
I did get the simplicity involved with Nic's Suggestion.
How would I get the results from the 3.3 option in batch would be my next question ( Any utilities which would get me to choose the PDS memebers to be included with wild cards as *) . If I could get some help there, that would be great.

Thanks.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jun 17, 2013 8:00 am
Reply with quote

Hi,

you can try something like this

Code:
//STEP0010 EXEC PGM=IKJEFT01                                         
//SYSTSPRT DD DSN=&&LISTPDS,                                         
//            DISP=(,PASS,DELETE),                                   
//            UNIT=SYSDA,                                             
//            SPACE=(TRK,(10,5),RLSE),                               
//            DCB=(RECFM=FB,LRECL=80)                                 
//SYSTSIN  DD  *                                                     
 LISTD 'OLD-PDS' M                                                   
//*                                                                   
//STEP0020 EXEC PGM=SORT                                             
//SORTIN   DD DSN=&&LISTPDS,                                         
//            DISP=(OLD,DELETE)                                       
//SORTOUT  DD DSN=&&SELECTED,                                         
//            DISP=(,PASS,DELETE),                                   
//            SPACE=(TRK,(10,5),RLSE)                                 
//SYMNAMES DD *                                                       
SEL#MEMS,'A1'     SELECT MEMBERS STARTING WITH A1                     
///SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'--MEMBERS--'),         
                 END=(1,5,CH,EQ,C'READY'),PUSH=(20:1,11)),             
*                                                                     
  IFTHEN=(WHEN=(1,11,CH,EQ,C'--MEMBERS--',OR,1,5,CH,EQ,C'READY'),     
                OVERLAY=(20:11X))                                     
*                             SELECT MEMBERS STARTING WITH A1         
*                                                          ||         
*                                                          ||         
  OUTFIL INCLUDE=(20,11,CH,EQ,C'--MEMBERS--',&,3,2,CH,EQ,SEL#MEMS),   
  BUILD=(C' S M=',3,8,80:X)                                           
/*                                                                     
//STEP0030 EXEC PGM=IEBCOPY,REGION=3072K                               
//SYSPRINT DD SYSOUT=*                                                 
//I1       DD DISP=SHR,DSN=OLD-PDS                                     
//O1       DD DSN=&&NEWPDS,                                           
//            DISP=(,PASS,DELETE),                                     
//            UNIT=SYSDA,                                             
//            SPACE=(TRK,(200,50,100),RLSE)                           
*                                                                   
//SYSIN    DD *                                         
COPY1 C O=O1,I=((I1,R))                                 
//         DD DSN=&&SELECTED,                           
//            DISP=(OLD,DELETE)                         
//*                                                     


then you can use IEBPTPCH using NEWPDS as input or you can use STEP0020 to generate IEBPTPCH statements, the ball is in your court


Gerry
Back to top
View user's profile Send private message
Dale Robertson

New User


Joined: 21 Jun 2013
Posts: 44
Location: U.S.A.

PostPosted: Tue Jun 25, 2013 2:25 am
Reply with quote

...if your shop has it. Saurabh, does your shop have SAS? If so then use PROC SOURCE and you'll be home free. Good luck.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Tue Jun 25, 2013 2:33 am
Reply with quote

Although you list only COBOL and JCL as skills, Saurabh, if someone in your shop knows ISPF services (and preferably Rexx, although you could call the services from COBOL), this becomes a trivial exercise.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Sat Jun 29, 2013 2:39 am
Reply with quote

Thanks all for the help and guidance, I could get through this and below is my code for the same.


Code:

//JS010    EXEC PGM=IKJEFT01             
//SYSTSPRT DD DSN=ABC.PDS.LIST,       
//            DISP=(OLD,CATLG,DELETE),   
//            SPACE=(TRK,(5,5),RLSE),     
//            DCB=(RECFM=FB,LRECL=80)     
//SYSPRINT DD SYSOUT=*                   
//SYSIN    DD DUMMY                       
//SYSTSIN  DD *                           
 LISTDS 'PDS Name' MEMBERS
/*                                       
//JS020   EXEC PGM=SORT                   
//SORTIN DD DSN=ABC.PDS.LIST,DISP=SHR 
//SORTOUT DD DSN=ABC.PDS.LIST1,     
//            DISP=(OLD,CATLG,DELETE),   
//            SPACE=(TRK,(5,5),RLSE),     
//            DCB=(RECFM=FB,LRECL=80)     
//SYSIN     DD  *                         
 SORT FIELDS=COPY                         
 INCLUDE COND=(3,3,CH,EQ,C'zzz') To sort members which have 'zzz'     
//*                                       
//JS030   EXEC PGM=SORT                     
//SORTIN DD DSN=ABC.PDS.LIST1,DISP=SHR 
//SORTOUT DD DSN=ABC.PDS.LIST2,       
//            DISP=(OLD,CATLG,DELETE),       
//            SPACE=(TRK,(5,5),RLSE),       
//            DCB=(RECFM=FB,LRECL=80)       
//SYSIN     DD  *                           
 SORT FIELDS=COPY                           
   OUTFIL REMOVECC,BUILD=(1:1,65,80:X),     
  HEADER1=('  PUNCH TYPORG=PO,MAXNAME=60')   
 OUTREC FIELDS=(C' MEMBER NAME=',3,8,80:X)   
//SYSOUT DD SYSOUT=*                         
//JS040   EXEC PGM=IEBPTPCH                           
//SYSPRINT  DD SYSOUT=*                               
//SYSUT1   DD  DSN=PDS.Member.name,DISP=SHR   
//SYSUT2   DD  DSN=ABC.TEST1.Out1,                 
//          DISP=(OLD,CATLG,DELETE),                 
//          SPACE=(CYL,(5,5),RLSE),                   
//          DCB=(RECFM=FBA,LRECL=81,BLKSIZE=0)       
//SYSIN     DD  DSN=ABC.PDS.LIST2,DISP=SHR     
//JS050   EXEC PGM=SORT                   
//SORTIN DD DSN=ABC.TEST1.OUT1,DISP=SHR 
//SORTOUT DD DSN=ABC.PDS.Final,     
//            DISP=(NEW,CATLG,DELETE),     
//            SPACE=(TRK,(5,5),RLSE),     
//            DCB=(RECFM=FB,LRECL=80)     
//SYSIN     DD  *                         
 SORT FIELDS=COPY                         
 INREC BUILD=(2,80)                       



Thanks again.

Regards,
Saurabh
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts first column truncated in search result IBM Tools 13
No new posts Duplicate several members of/in one l... JCL & VSAM 7
Search our Forums:

Back to Top