View previous topic :: View next topic |
Author |
Message |
manoj nayak Banned
Joined: 12 Apr 2007 Posts: 15 Topics: 8 Location: Ind
|
Posted: Tue Jun 05, 2007 2:09 am Post subject: search internal table code doubt |
|
|
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 |
|
 |
Sreejith Intermediate
Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
|
Posted: Tue Jun 05, 2007 2:42 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jun 05, 2007 3:22 am Post subject: |
|
|
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 |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Tue Jun 05, 2007 8:54 am Post subject: |
|
|
Basically the code is LOADING the COBOL Internal table with Unique entries - probably from an input file.
Thanks,
Phantom |
|
Back to top |
|
 |
|
|