View previous topic :: View next topic
|
Author |
Message |
adarsh.bhalke
New User
Joined: 06 May 2007 Posts: 16 Location: pune
|
|
|
|
Hi,
i have one table defined as
WS-DEBITOR-TABLE PIC X(150) OCCURS 1000 TIMES INDEXED BY DEBITOR-IDX
In this case can I use a reference modification to select the perticular string like
WS-DEBITOR-TABLE(DEBITOR-IDX)(20:24)
Please tell me its very urgent
thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
Please tell me its very urgent |
It is strange when people say it is urgent and WASTE a lot of their time by expecting answers from others.
Even I had not used such reference modification before but it took me just 2 minutes to test it with simple program.
Code: |
01 TEXT-VAR PIC X(10).
01 TEMP1.
05 V1 PIC X(10) OCCURS 10 TIMES.
PROCEDURE DIVISION.
MOVE 'ABHIJIT' TO V1(1).
MOVE 'K' TO V1(2).
MOVE V1(1)(1:7) TO TEXT-VAR
DISPLAY TEXT-VAR.
STOP RUN. |
I got it running so answer to your question should be YES. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
adarsh.bhalke wrote: |
can I use a reference modification to select the perticular string |
Why would you think you couldn't?
Personally, I keep forgetting what must come first, the RM or the subscript....when I get wrong, the compiler corrects me.... |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Here's how to remember: the refmod acts on a character string. A table name sans subscript or index is not a character string, and by itself elicits a compiler error, hence the refmod follows the sub/idx. |
|
Back to top |
|
|
|