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

How to change the String in a file


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

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Mon Jul 16, 2007 3:48 pm
Reply with quote

I want to change a string in a file.

EG:

AAAAAA N
BBBBBB N
CCCCC N
AAAAAA N
CCCCC N

Here i need to change all 'AAAAAA' to 'CCCCCC'.




Regards,
Nagu.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 4:01 pm
Reply with quote

Search your sort manual or the forum, it is easy and simple.
Let us know if you can't find how to do it.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 4:02 pm
Reply with quote

Nagu,

Required DFSORT JCL -

Code:
//SOMESTEP  EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                       
//SYSPRINT DD SYSOUT=*                       
//*                                         
//SORTIN DD *                               
AAAAAAA                                     
CCCCCCC                                     
BBBBBBB                                     
AAAAAAA                                     
/*                                           
//SORTOUT DD SYSOUT=*                       
//SYSIN DD *                                 
  SORT FIELDS=COPY                           
  INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'AAAAAA'), 
                OVERLAY=(1:C'CCCCCC'))       
/*                                           


Output:

Code:
CCCCCCA   
CCCCCCC   
BBBBBBB   
CCCCCCA   
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Mon Jul 16, 2007 4:07 pm
Reply with quote

Nagendran,
You can do this with DFSORT.
Code:

//STEP1   EXEC PGM=SORT                                   
//SORTIN  DD *                                           
AAAAAA N                                                 
BBBBBB N                                                 
CCCCCC N                                                 
AAAAAA N                                                 
CCCCCC N                                                 
/*                                                       
//SORTOUT DD SYSOUT=*                                     
//SYSOUT  DD SYSOUT=*                                     
//SYSIN   DD *                                           
     OPTION COPY                                         
     OUTREC OVERLAY=(1,6,CHANGE=(6,C'AAAAAA',C'CCCCCC'), 
     NOMATCH=(1,6))                                       
/*                                                       


--Parag
Back to top
View user's profile Send private message
Nagendran

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Mon Jul 16, 2007 4:57 pm
Reply with quote

Hi,
Thanks for ur response.

If i use first approach i am getting unidentified IFTHEN statement.
If i use second approach i am getting unidentified OVERLAY statement.

Regards,
Nagu
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 5:08 pm
Reply with quote

Nagu,

If you need any assistance from us, please post the spool messages. By the way, does your shop support DFSORT?
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: Mon Jul 16, 2007 9:16 pm
Reply with quote

Nagu,

You need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 in order to use DFSORT's IFTHEN and OVERLAY functions. These PTFs have been available since Dec, 2004.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top