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
 

 

Replace a pattern in a record in dynamic position.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
DebaMF

New User


Joined: 13 Nov 2014
Posts: 4
Location: Bangalore

PostPosted: Fri Nov 14, 2014 11:47 am    Post subject: Replace a pattern in a record in dynamic position.
Reply with quote

I have a file with multiple records where a specific phrase/pattern need to find out replace with another set of specific text. Position of specific phrase/pattern in a record is not fixed. The file length is 50 bytes.

Input File:

MAINAK INCOME ANNUL AT RS 1000
JOHN INCOME MONTH AT RS 1340
MAXICANA INCOME DAILY AT RS 1568

The specific phrase/pattern is 'INCOME %%%%% AT RS', where '%%%%%' is variable but it will be always 5 bytes. Need to replace 'INCOME %%%%% AT RS' with 'INCOME DETAILS'.
In another way, wherever 'AT RS' is found, need to replace: the minus 6 bytes of 'AT RS' plus 'AT RS' with 'DETAILS'.

Output File:
MAINAK INCOME DETAILS 1000
JOHN INCOME DETAILS 1340
MAXICANA INCOME DETAILS 1568

It will be great help if anyone can please help me to build the SORT card (SYNCSORT) to achieve this.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Nov 14, 2014 12:35 pm    Post subject: Reply to: Replace a pattern in a record in dynamic position.
Reply with quote

do not double post ...

the people replying here ( this forum )
are the same replying there
http://ibmmainframeforum.com/viewtopic.php?f=61&t=10289

double posting will not get You double answers in the same time
or the same number of answers in half the time icon_cool.gif
Back to top
View user's profile Send private message
DebaMF

New User


Joined: 13 Nov 2014
Posts: 4
Location: Bangalore

PostPosted: Fri Nov 14, 2014 1:42 pm    Post subject: Re: Reply to: Replace a pattern in a record in dynamic posit
Reply with quote

Sorry Enrico....I didn't know that both forum are same only.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Nov 14, 2014 3:59 pm    Post subject: Reply to: Replace a pattern in a record in dynamic position.
Reply with quote

they are different forums

but... on this forum a bit of experience is expected
the other forum is for beginners

if You ask here what is COBOL You might get a bit of bashing icon_wink.gif

c /are the same replying there/are ALMOST the same replying there/

at least those with more experience
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Nov 14, 2014 9:27 pm    Post subject:
Reply with quote

Try this:

Code:
C P'INCOME ===== AT RS'  'INCOME DETAILS' ALL
Back to top
View user's profile Send private message
DebaMF

New User


Joined: 13 Nov 2014
Posts: 4
Location: Bangalore

PostPosted: Fri Nov 14, 2014 9:31 pm    Post subject:
Reply with quote

Hi mistah,

I am trying to do it in a SORT card, not using 'C ALL'. This will be the JCL piece, which will process millions of records in a Batch process.
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 61
Location: India

PostPosted: Sat Nov 15, 2014 1:18 am    Post subject:
Reply with quote

Is it tough to list all possible %%%%% values???
Back to top
View user's profile Send private message
DebaMF

New User


Joined: 13 Nov 2014
Posts: 4
Location: Bangalore

PostPosted: Sat Nov 15, 2014 11:41 am    Post subject:
Reply with quote

Hi Arun,

Yes, there is no limit/restriction on the ' %%%%%' values.
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 -> JCL & VSAM 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 update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm


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