Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us