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

COPY with REPLACING Option to replace partial Text


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Manojtyagi1979

New User


Joined: 25 Jan 2010
Posts: 11
Location: Noida

PostPosted: Mon Mar 29, 2010 3:32 pm
Reply with quote

I have a Copybook

Copybook AHD-REC containing fields

05 AHD-ID
05 AHD-POL-NUM
05 AHD-DATE
etc ...

I want the partial Text "AHD" to be replaced by "HLD" in entire Copybook during my program RUN.

I have tried following , but they are not working.

a) 01 HOLD-REC COPY AHD-REC
replacing ==AHD== by ==HLD==

b) 01 HOLD-REC COPY AHD-REC
replacing :AHD: by :HLD:

c) 01 HOLD-REC COPY AHD-REC
replacing (AHD) by (HLD).

Please help me

thanks & regards
Manoj
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 29, 2010 3:56 pm
Reply with quote

You might like to review this thread and the fine manual.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Mar 29, 2010 3:56 pm
Reply with quote

Whole words only or partial words with delimiters only....

The COPY statement with REPLACING phrase can be used to replace parts of words. By inserting a dummy operand delimited by colons into the program text, the compiler will replace the dummy operand with the desired text.

Replacing function in cobol
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top