VMS Help  —  RDML72  Statements  Declared START STREAM, Examples  Pascal Example
    program anycond (input,output);
    DATABASE PERS = FILENAME 'PERSONNEL';

    var
    end_of_stream : boolean;

    DECLARE_STREAM sal USING SH IN SALARY_HISTORY
         WITH SH.SALARY_AMOUNT LT 10000;

    begin
        READY PERS;
        START_TRANSACTION READ_WRITE;

        START_STREAM sal;

        FETCH sal
         AT END
           end_of_stream := TRUE;
        END_FETCH;

        while not end_of_stream do
         begin
           MODIFY SH USING
             SH.SALARY_AMOUNT := SH.SALARY_AMOUNT * (1.5);
           END_MODIFY;

           FETCH sal
             AT END
               end_of_stream := TRUE;
           END_FETCH;

         end;

        END_STREAM sal;
        COMMIT;
        FINISH;
    end.
Close Help