Update URL Records

When used in conjunction with UFNDBEG and UFNDNXT, the USTORE API is used to update an existing URL record. First, find the URL, then set the new values, and then perform USTORE.

When D<Prefix>@U@DTUSR = 1, the program can change the D<Prefix>@U@CRTDT, D<Prefix>@U@CRTTM, D<Prefix>@U@MODDT, and/or D<Prefix>@U@MODTM fields and the program supplied values will be written to the database. If D<Prefix>@U@DTUSR is not 1, then the D<Prefix>@U@MODDT and D<Prefix>@U@MODTM fields will be set to the current system date and time before the record is written to the database.

Programming Example

This code changes the value of the D<Prefix>@U@TYPE field of the URL attachments associated with COMPANY 1000 from "H" to "P".

MOVE 1000 TO DB-COMPANY.

PERFORM 910-AUDIT-BEGIN.

PERFORM 840-FIND-COMSET1.

IF (COMPANY-FOUND)
    MOVE 0    TO URLCOM-URL-ORDER
    MOVE "H"  TO URLCOM-TYPE

    PERFORM 900-FIND-BEGRNG-URL-COMPANY

    PERFORM UNTIL (URLCOM-NOTFOUND)
        MOVE "P" TO URLCOM-TYPE
        PERFORM 900-STORE-URL-COMPANY
        ... note that the value of URLCOM-TYPE changed, so we need to reset it ...
        MOVE "H" TO URLCOM-TYPE
        PERFORM 900-FIND-NXTRNG-URL-COMPANY
        END-PERFORM
    END-PERFORM
END-IF.

PERFORM 920-AUDIT-END.