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: 10292
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: 10292
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: 287
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: 63
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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm


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