View previous topic :: View next topic
|
Author |
Message |
jaganmoni1
New User
Joined: 31 Oct 2008 Posts: 35 Location: CANADA
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Code: |
COPY ABCDE REPLACING ==BLMASTER== WITH ==BLMST==. |
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
jaganmoni1
New User
Joined: 31 Oct 2008 Posts: 35 Location: CANADA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Oooooh, two mistakes in one line. That's a new record for me.
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 |
|
|
|