MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Doubt Regarding SSRANGE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Thu Aug 19, 2004 8:21 am    Post subject: Doubt Regarding SSRANGE Reply with quote

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
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Thu Aug 19, 2004 10:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Thu Aug 19, 2004 10:07 am    Post subject: Reply with quote

Just to add: This is all working exactly as expected; what results did you expect and why?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group