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
 

 

Need help on RPLACING verb

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Mon Jun 15, 2009 2:11 pm    Post subject: Need help on RPLACING verb
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: 1228
Location: Israel

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

Code:
COPY ABCDE REPLACING ==BLMASTER== WITH ==BLMST==.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Jun 15, 2009 7:03 pm    Post subject:
Reply with quote

http://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: 33
Location: CANADA

PostPosted: Tue Jun 16, 2009 1:46 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Jun 16, 2009 2:56 pm    Post subject:
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: 1228
Location: Israel

PostPosted: Tue Jun 16, 2009 7:18 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Logic of START verb with Read next sandeep kumar302 COBOL Programming 6 Tue Feb 04, 2014 12:21 pm
No new posts Calling sub program using CALL verb Ron Masters COBOL Programming 16 Fri Apr 06, 2012 4:37 pm
No new posts Need help in understanding the Move v... Himanshu Pant COBOL Programming 2 Fri Mar 30, 2012 2:47 pm
No new posts Capturing the EX value x'15' using IN... ragu.vst COBOL Programming 8 Mon Dec 19, 2011 10:12 pm
No new posts Why TEST verb used with INITIALIZE MoganaKumaran COBOL Programming 6 Tue Apr 05, 2011 6:52 pm


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