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 

search internal table code doubt

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


Joined: 12 Apr 2007
Posts: 15
Topics: 8
Location: Ind

PostPosted: Tue Jun 05, 2007 2:09 am    Post subject: search internal table code doubt Reply with quote

Code:

01  W-DEPTS-TABLE.                                     
    05    W-DEPTS-TBL    OCCURS 0 TO 30000 TIMES       
                        DEPENDING ON A-DEPTS-WRITTEN   
                        INDEXED BY W-DEPTS-NDX.       
        10 W-DEPTS-TBL-REC     PIC X(03) VALUE SPACES.

SEARCH W-DEPTS-TBL                                         
    AT END                                                 
       MOVE read-dept-from-file     TO W-DEPTS-TBL-REC(W-DEPTS-NDX)
    WHEN W-DEPTS-TBL-REC(W-DEPTS-NDX) = W-DEPTS-KEY       
       CONTINUE                                           
END-SEARCH                     


"WHEN W-DEPTS-TBL-REC(W-DEPTS-NDX) = W-DEPTS-KEY"

can anybody explain me what is the meaning of this line in the above codes?
Back to top
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Tue Jun 05, 2007 2:42 am    Post subject: Reply with quote

Storing all Departments from dept-from-file to an array. So the line you mentioned is checking whether the dept is already in the array.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 05, 2007 3:22 am    Post subject: Reply with quote

and if so, do nothing (CONTINUE is a NO-OP), and since a condition of the search is satisfied, the search is ended.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jun 05, 2007 8:54 am    Post subject: Reply with quote

Basically the code is LOADING the COBOL Internal table with Unique entries - probably from an input file.

Thanks,
Phantom
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