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
 

 

How to change the String in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to change the String in a file
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 4:01 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 4:02 pm    Post subject:
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    Post subject:
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    Post subject: Re: How to change the String in a file by using JCL?
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: 1439
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 5:08 pm    Post subject:
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 Moderator


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

PostPosted: Mon Jul 16, 2007 9:16 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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