         SYSTEM   SIG7FDP
         SYSTEM   BPM
*
*        RELFILES  CLOSE AND RELEASE DISC FILE TO THE MONITOR
*
*                 THIS ROUTINE WILL CLOSE AND RELEASE DISC FILES TO
*                 MONITOR WHEN THE COBOL PROGRAMMER IS THROUGH USING
*                 THEM
*
*      USER SYNTAX:
*
*        ENTER    RELFILES  FILE-NAME-1, FILE-NAME-2, ..., FILE-NAME-N
*
*              FILE NAME-1: AN APPROPRIATE FD NAME
*                .    .
*                .    .
*                .    .
*              FILE-NAME-N: THE LAST OF MULTIPLE FILES TO BE CLOSED
*                           AND RELEASED
*
*        AUTHER   YOW-YUAN ROBERT LIN            MAY, 1970
         DEF      RELFILES
         OPEN     LOOP,GO,CLOS,ABNADDR,RETURN,SAVE,MCLOSE
         OPEN     FPTO,FPTCC,FPTOO,FPTC
RELFILES LCI      7
         STM,14   SAVE
         STW,15   RETURN
         AWM,14   RETURN
         B        GO
LOOP     AI,15    1                 UPDATE POINTR TO PARAM
GO       LI,3     X'1FFFF'          MASK
         LS,2     *15               R2 = ADDR OF DCB
         STS,2    FPTO              SET DCB ADDR
         STS,2    FPTOO             SET DCB ADDR
         STS,2    FPTC              SET DCB ADDR
         STS,2    FPTCC             SET DCB ADDR
         LW,1     *2                0TH WORD OF DCB
         AND,1    L(X'00200000')    TEST FILE OPEN
         CI,1     0
         BNE      CLOS              FILE IS ALREADY OPENED
,FPTO    M:OPEN   0,(INOUT)
*        AS OF JUNE 1970, THIS WILL WORK ONLY IF (INOUT) IS SPECIFIED
         B        MCLOSE
CLOS     RES      0
,FPTCC   M:CLOSE  DCB
,FPTOO   M:OPEN   0,(REL)
MCLOSE   RES      0
,FPTC    M:CLOSE  DCB,(REL)
         BDR,14   LOOP
         LCI      7
         LM,14    SAVE
         B        *RETURN
DCB      RES      1                 DUMMY DCB NAME
RETURN   RES      1
SAVE     RES      7
         CLOSE    LOOP,GO,CLOS,ABNADDR,RETURN,SAVE,MCLOSE
         CLOSE    FPTO,FPTCC,FPTOO,FPTC
         END
