RDOHELP72.HLB  —  START_SEGMENT, Example
    INVOKE DATABASE FILENAME 'PERSONNEL'

    START_STREAM STREAM USING R IN RESUMES
         FETCH STREAM
           START_SEGMENTED_STRING STRING USING T IN R.RESUME
              GET !VAL = T.RDB$VALUE;
                  !VAL = T.RDB$LENGTH
              END_GET
           END_SEGMENTED_STRING STRING
    END_STREAM STREAM

    This example:

    o  Starts a stream with the stream name STREAM. END_STREAM STREAM
       closes the block.

    o  Uses the FETCH statement to move the stream pointer to the
       first record in the relation RELNAME.

    o  Uses START_SEGMENTED_STRING to start a stream of segments from
       the RESUME field of RESUMES. Note that the context variable
       (R) on RESUME relates it to RESUMES.

    o  Uses GET to retrieve each segment and its length. The second
       context variable relates each segment value to the segmented
       string field, RESUME. The COBOL program displays the results.

    o  Encloses both the FETCH and the GET in loops. This outer and
       inner looping structure is necessary to retrieve each record
       and each segment within RESUME.
Close Help