View previous topic :: View next topic
|
Author |
Message |
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
Hi,
In the below declaration,
SET LETTERPOS TO LETT. => Compilation error
SET LETTERPOS TO LETTERIDX. => This one compiled fine.
Only differnece, is LETTERIDX => used to index a table
LETT => decalred as a index variable.
So is it right to say that we can use set non-index variable to index variable only for index used with occurs clause.. I am not sure what i am missing here..
Declaration:
Code: |
01 LETTERTABLE.
02 LETTERVALUES.
03 FILLER PIC X(13)
VALUE "ABCDEFGHIJKLM".
03 FILLER PIC X(13)
VALUE "NOPQRSTUVWXYZ".
02 FILLER REDEFINES LETTERVALUES.
03 LETTER PIC X OCCURS 26 TIMES
INDEXED BY LETTERIDX.
02 FILLER REDEFINES LETTERVALUES.
03 LETTE1 PIC X OCCURS 26 TIMES
ASCENDING KEY IS LETTE1
INDEXED BY LETTERID1.
01 LETTERIN PIC X.
01 LETT USAGE IS INDEX.
01 LETTERPOS PIC 99.
01 PRNPOS PIC Z9.
|
Statements:
Code: |
ACCEPT LETTERIN.
SET LETTERIDX TO +1.
SET LETTERPOS TO LETT.
SET LETTERPOS TO LETTERIDX.
MOVE 1 TO LETTERPOS. |
Thanks
Yuge |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
using the code tags to make your code more readable will make answering a pleasure rather than a pain in the a**
Your topic was edited ... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What you are missing is reading the manuals. Link at the top of the page.
If there is anything which is unclear after that, explain your problem and someone will clarify.
As well as looking at SET (you only need format 1 for your question, but may as well see the other marvels at the same time) you should check on USAGE INDEX. |
|
Back to top |
|
|
|