View previous topic :: View next topic |
Author |
Message |
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Thu Aug 19, 2004 8:21 am Post subject: Doubt Regarding SSRANGE |
|
|
Hi,
Can u explain why W-CLIENT(004) value is showing as '004' in my sysout even though I defined as occurs 3 times.I used NOSSRANGE option.for
But W-CLIENT(>004) is showing as spaces.
Code: |
WORKING-STORAGE SECTION.
01 W-CLIENT-LIST-RECORD.
05 W-CLIENT-LIST PIC X(9).
05 FILLER REDEFINES W-CLIENT-LIST.
10 W-CLIENT OCCURS 3 TIMES
PIC X(003).
05 W-SUB PIC 9(3).
PROCEDURE DIVISION.
MOVE '001' TO W-CLIENT(1).
MOVE '002' TO W-CLIENT(2).
MOVE '003' TO W-CLIENT(3).
DISPLAY 'W-CL-LIST: ' W-CLIENT-LIST
MOVE 003 TO W-SUB.
DISPLAY 'TEST1 : ' W-CLIENT(W-SUB).
MOVE 004 TO W-SUB.
DISPLAY 'TEST2 : ' W-CLIENT(W-SUB).
MOVE 123 TO W-SUB.
DISPLAY 'TEST3 : ' W-CLIENT(W-SUB).
STOP RUN.
|
Thanks,
Vijay |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu Aug 19, 2004 10:04 am Post subject: |
|
|
NOSSRANGE means NO subscript checking. So displaying W-CLIENT(x) with x>3 will be allowed and will show you whatever is in storage at the relevant offset.
I ran your program and got the following result:
W-CL-LIST: 001002003
TEST1 : 003
TEST2 : 004
TEST3 :
Note that because W-SUB is immediately after W-CLIENT(3), the contents of W-SUB are shown when you try to display W-CLIENT(4).
Referencing W-CLIENT(123) will give you whatever is in storage 120*3=360 bytes after the end of the W-CLIENT array. This could vary. |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu Aug 19, 2004 10:07 am Post subject: |
|
|
Just to add: This is all working exactly as expected; what results did you expect and why? |
|
Back to top |
|
|
|
|