|
View previous topic :: View next topic
|
| Author |
Message |
Saurabh Pune
New User

Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
 |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
Saurabh Pune
New User

Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
 |
Dale Robertson
New User

Joined: 21 Jun 2013 Posts: 44 Location: U.S.A.
|
|
|
|
| ...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 |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
| 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 |
|
 |
Saurabh Pune
New User

Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|