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
 

 

Search and Merge selected PDS Members

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Search and Merge selected PDS Members
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: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Sun Jun 16, 2013 4:58 pm    Post subject:
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: 1712
Location: UK

PostPosted: Mon Jun 17, 2013 12:06 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jun 17, 2013 8:00 am    Post subject:
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    Post subject: Solution with SAS...
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: 1738
Location: Bloomington, IL

PostPosted: Tue Jun 25, 2013 2:33 am    Post subject:
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    Post subject:
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    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 Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts SQL Merge error -254 Robin Sulsona DB2 8 Wed Jun 01, 2016 8:28 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm
No new posts Differences between copying members b... E.LAI TSO/ISPF 8 Wed Mar 30, 2016 12:35 pm


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