View previous topic :: View next topic
Author
Message
itmanand New User Joined: 18 Dec 2008Posts: 24 Location: Newyork
I have a PDS file with 100 members. I want to replace some strings in each member of the PDS. Can I use ICETOOL to do this? Can I specify this without using multiple statments for each member? The below step throws an error asking to specify the member name.
//STEP02 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN001 DD DSN=XXX.TEST,DISP=SHR
//OUT001 DD DSN=XXX.TEST.OUT,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120),
// SPACE=(CYL,(50,10),RLSE)
//TOOLIN DD *
COPY FROM(IN001) TO(OUT001) USING(CTL1)
//CTL1CNTL DD *
Back to top
Escapa Senior Member Joined: 16 Feb 2007Posts: 1399 Location: IL, USA
I don't know if is easily achievable using sort but For such request REXX is always preferred...
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
DFSORT can operate on a PDS(member), but not on all the members of a PDS at once.
Gerry
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
Can I specify this without using multiple statments for each member?
No. DFSORT can use a PDS member for input and output, but it cannot use a PDS for input or output.
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
itmanand,
If you insist on doing using batch utilities then the following JCL will give you the desired results.
STEP0200 Uses DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to replace the string 'sysprint' to 'DFSRTPRT'. You need to put your change strings there.
Code:
//*************************************************************
//* PRINT THE PDS TO A FLAT FILE *
//*************************************************************
//STEP0100 EXEC PGM=IEBPTPCH
//SYSUT1 DD DSN=YOUR.PDS.TO.BE.REPLACED,
// DISP=SHR
//SYSUT2 DD DSN=&&T,DISP=(,PASS),SPACE=(CYL,(10,10),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PUNCH TYPORG=PO
//*
//*************************************************************
//* REPLACE THE DESIRED STRING TO YOUR STRING *
//*************************************************************
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&T,DISP=(OLD,PASS)
//SORTOUT DD DSN=&&O,DISP=(,PASS),SPACE=(CYL,(10,10),RLSE),RECFM=FB
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(2,80)),
IFTHEN=(WHEN=INIT,FINDREP=(IN=C'SYSPRINT',OUT=C'DFSRTPRT'))
OUTREC IFTHEN=(WHEN=(1,11,CH,EQ,C'MEMBER NAME'),
BUILD=(C'./ ADD NAME=',14,8,80:X))
//*
//*************************************************************
//* DELETE THE ORIGINAL PDS *
//*************************************************************
//STEP0300 EXEC PGM=IEFBR14,COND=(0,NE,STEP0200)
//DELPDS DD DSN=YOUR.PDS.TO.BE.REPLACED,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(TRK,(1,0),RLSE)
//*
//*************************************************************
//* THIS STEP CREATES PDS FROM A SEQUENTIAL FILE *
//*************************************************************
//STEP0400 EXEC PGM=IEBUPDTE,PARM=NEW,COND=(0,NE,STEP0200)
//SYSUT2 DD DSN=YOUR.PDS.TO.BE.REPLACED,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,10,100),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&O,DISP=(OLD,PASS)
//*
For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links
Back to top
itmanand New User Joined: 18 Dec 2008Posts: 24 Location: Newyork
Thanks. However for the last step, when I try to create the PDS I get S013 with a RC of 20.
Can you let me know if this allocation parameter for the PDS is correct?
//SYSUT2 DD DSN=mypds,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200),
// SPACE=(CYL,(10,10,100),RLSE)
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
itmanand,
What are the DCB parameters of SORTOUT in step0200? Did you have the cond code check on step0300 and step0400?
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Back to top
itmanand New User Joined: 18 Dec 2008Posts: 24 Location: Newyork
I had the DCB parameters as the same that you gave in your example.
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
itmanand wrote:
I had the DCB parameters as the same that you gave in your example.
itmanand,
Unless I am blind , I don't see a single DCB parameter coded in my example job. Where did you see them?
Back to top
Please enable JavaScript!