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

Need help on RPLACING verb


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

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Mon Jun 15, 2009 2:11 pm
Reply with quote

Hi,

I have a copy book name ABCDE with structure as
01 BLMASTER-RECORD.
05 BLMASTER-COMMON.
10 BLMASTER-BANK-NO PIC S9(03) COMP-3.
10 BLMASTER-TRANSIT-NO PIC S9(05) COMP-3.
10 BLMASTER-ACCOUNT-NO PIC S9(07) COMP-3.
10 BLMASTER-LOAN-NO PIC S9(03) COMP-3.
10 BLMASTER-RECORD-ID PIC S9(03) COMP-3.
88 BLMASTER-DATE-CDE-000 VALUE +000.
88 BLMASTER-BANK-CDE-010 VALUE +010.
88 BLMASTER-BRANCH-HDR-CDE-020 VALUE +020.
88 BLMASTER-ACCOUNT-REC-CDE-030 VALUE +030.
88 BLMASTER-LOAN-REC-CDE-140 VALUE +140.
88 BLMASTER-BRANCH-TRLR-CDE-980 VALUE +980.

In my program I want to replace BLMASTER as BLMST and I have to use variables as BLMST-BANK-NO, BLMST-LOAN-NO etc...

Can any help me to replace only the first word of the copy book variables?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jun 15, 2009 6:41 pm
Reply with quote

Code:
COPY ABCDE REPLACING ==BLMASTER== WITH ==BLMST==.
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 Jun 15, 2009 7:03 pm
Reply with quote

www.ibmmainframes.com/viewtopic.php?t=33725&highlight=tag
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Tue Jun 16, 2009 1:46 pm
Reply with quote

Hi Masro,

It is not replacing BLMASTER with BLMST after using your code.

Hi Anuj,
I didnt see any solution on that link
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jun 16, 2009 2:56 pm
Reply with quote

You can work around in a similar fashion what mmwife has suggested there:
mmwife wrote:
If you created the copybook or you can change it, you can do the following: Change all occurrances of PFX:
Code:
05  (PFX)-OCC-RECID                        PIC X(03).
to
Code:
05  (PFX-)OCC-RECID                        PIC X(03).

In the pgm code:
Code:
COPY XXXXXXXX REPLACING ==(PFX-)== BY ====
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 16, 2009 7:18 pm
Reply with quote

Oooooh, two mistakes in one line. That's a new record for me. icon_sad.gif

1. It should have been BY and not WITH.
2. I've always thought that use of the colon (as in ==:TAG:==) is a convention, not a restriction.

The COBOL book is not very clear about the REPLACING format:
Quote:
Keep in mind that a character-string must be delimited by separators. For more information, see "Characters" in topic 1.1.
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
This topic is locked: you cannot edit posts or make replies. regarding COBOL WRITE verb (VB File H... COBOL Programming 9
No new posts Logic of START verb with Read next COBOL Programming 6
No new posts Calling sub program using CALL verb COBOL Programming 16
No new posts Need help in understanding the Move v... COBOL Programming 2
No new posts Capturing the EX value x'15' using IN... COBOL Programming 8
Search our Forums:

Back to Top