View previous topic :: View next topic
|
Author |
Message |
DebaMF
New User
Joined: 13 Nov 2014 Posts: 4 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
DebaMF
New User
Joined: 13 Nov 2014 Posts: 4 Location: Bangalore
|
|
|
|
Sorry Enrico....I didn't know that both forum are same only. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
c /are the same replying there/are ALMOST the same replying there/
at least those with more experience |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Try this:
Code: |
C P'INCOME ===== AT RS' 'INCOME DETAILS' ALL |
|
|
Back to top |
|
|
DebaMF
New User
Joined: 13 Nov 2014 Posts: 4 Location: Bangalore
|
|
|
|
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 |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Is it tough to list all possible %%%%% values??? |
|
Back to top |
|
|
DebaMF
New User
Joined: 13 Nov 2014 Posts: 4 Location: Bangalore
|
|
|
|
Hi Arun,
Yes, there is no limit/restriction on the ' %%%%%' values. |
|
Back to top |
|
|
|