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

ICETOOL for a PDS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
itmanand

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Thu Apr 16, 2009 3:28 am
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 16, 2009 3:32 am
Reply with quote

I don't know if is easily achievable using sort but For such request REXX is always preferred...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Apr 16, 2009 4:29 am
Reply with quote

Hi,

DFSORT can operate on a PDS(member), but not on all the members of a PDS at once.


Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 16, 2009 4:32 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 16, 2009 5:28 am
Reply with quote

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
View user's profile Send private message
itmanand

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Thu Apr 16, 2009 9:16 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 16, 2009 9:25 pm
Reply with quote

itmanand,

What are the DCB parameters of SORTOUT in step0200? Did you have the cond code check on step0300 and step0400?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 16, 2009 9:27 pm
Reply with quote

itmanand wrote:
Thanks. However for the last step, when I try to create the PDS I get S013 with a RC of 20.
013
Explanation: The error occurred during processing of an OPEN macro instruction. This system completion code is accompanied by message IEC141I. Refer to the explanation of message IEC141I for complete information about the task that was ended and for an explanation of the return code in register 15 (which is provided in the IEC141I message text).
Application Programmer Response: Respond as indicated for message IEC141I.
System Programmer Response: If the error recurs and the program is not in error, look at the messages in the job log for more information. Search problem reporting data bases for a fix for the problem. If no fix exists, contact the IBM Support Center. Provide the JCL and the program listing for the job.
Back to top
View user's profile Send private message
itmanand

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Fri Apr 17, 2009 12:26 am
Reply with quote

I had the DCB parameters as the same that you gave in your example.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Apr 17, 2009 1:25 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top