Searching a Table (COBOL)?

You should index your table using something like: 05 TABLE-ENTRIES OCCURS 99 TIMES INDEXED BY IND-TABLE-ENTRIES Then you can use the SEARCH verb: 510-TABLE-SEARCH. SEARCH TABLE-ENTRIES UNTIL SALESMAN-NUMBER (IND) = 0 WHEN SALESMAN-NUMBER (IND) = ROUTINE-CHECK PERFORM 520-WRITE-FILE END-SEARCH Table indices are always numeric since they are used as pointers (they contain a memory address). The SET verb is normally used to modify table indices.

You should index your table using something like: 05 TABLE-ENTRIES OCCURS 99 TIMES INDEXED BY IND-TABLE-ENTRIES. Then you can use the SEARCH verb: 510-TABLE-SEARCH. SEARCH TABLE-ENTRIES UNTIL SALESMAN-NUMBER (IND) = 0 WHEN SALESMAN-NUMBER (IND) = ROUTINE-CHECK PERFORM 520-WRITE-FILE END-SEARCH.

Table indices are always numeric since they are used as pointers (they contain a memory address). The SET verb is normally used to modify table indices.

You can use two WHEN clauses in a search, but besides that this helped out alot. Now all I need to know is how to move the stored info to the field I want. – Kimmy1235 Feb 6 at 22:40 I don't have a compiler available here, so syntax may be wrong: MOVE DL-NAME-COLUMN TO SALESMAN-NAME(IND).

You should previously set IND to the index of the table you want to modify. – Fernando Martin Feb 6 at 23:06 I don't want to modify the table. I want to take information from the table and put it into DL-NAME-COLUMN.

– Kimmy1235 Feb 6 at 23:25 I see, well then do it the other way around; MOVE SALESMAN-NAME(IND) TO DL-NAME-COLUMN. – Fernando Martin Feb 6 at 23:29 ok, I feel stupid now. That did it perfectly.

Thanks! – Kimmy1235 Feb 6 at 23:50.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions