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

Replace a pattern in a record in dynamic position.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 14, 2014 12:35 pm
Reply with quote

do not double post ...

the people replying here ( this forum )
are the same replying there
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 14, 2014 3:59 pm
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: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Nov 14, 2014 9:27 pm
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
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: 63
Location: India

PostPosted: Sat Nov 15, 2014 1:18 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top