900-DELETE-URL and 900-DELETE-RNG-URL

The 900-DELETE-URL-<FileName> is used to delete the current URL record.

The 900-DELETE-RNG-URL-<FileName> API is used to delete all of the URL records associated with the current base table record.

When either of these APIs deletes the last attachment associated with the base table record, it will also clear the L_INDEX in the base record. This can have the side-effect of releasing any lock held on that record.

Programming Examples

This code uses 900-DELETE-RNG-CMT and 900-DELETE-RNG-URL to delete all of the attachments associated with COMPANY 1000.

PERFORM 910-AUDIT-BEGIN.

MOVE 1000 TO DB-COMPANY.
PERFORM 840-LOCK-COMSET1.

IF (COMPANY-FOUND)
    INITIALIZE WS-CMTCOM
               WS-URLCOM
    PERFORM 900-DELETE-RNG-CMT-COMPANY
    PERFORM 900-DELETE-RNG-URL-COMPANY
    PERFORM 830-DELETERNG-COMSET1
END-IF.

PERFORM 920-AUDIT-END.

This code uses 900-DELETE-URL to delete the URLs associated with COMPANY 1000 that were created in 2012.

PERFORM 910-AUDIT-BEGIN.

MOVE 20120101 TO PRM-FROM-DATE.
MOVE 20121231 TO PRM-TO-DATE.

MOVE 1000 TO DB-COMPANY.
PERFORM 840-FIND-COMSET1.

IF (COMPANY-FOUND)
    MOVE 3      TO URLCOM-URL-ORDER
    MOVE SPACES TO URLCOM-TYPE

    PERFORM 900-FIND-BEGRNG-URL-COMPANY

    PERFORM UNTIL (URLCOM-NOTFOUND)
        IF (PRM-FROM-DATE <= URLCOM-CREATE-DATE)
        AND (URLCOM-CREATE-DATE <= PRM-TO-DATE)
            PERFORM 900-DELETE-URL-COMPANY
        END-IF
        ... the value of URLCOM-TYPE changed, so we need to reset it ...
        MOVE SPACES TO URLCOM-TYPE
        PERFORM 900-FIND-NXTRNG-URL-COMPANY
        END-PERFORM
    END-PERFORM
END-IF.

PERFORM 920-AUDIT-END.