         TITLE    'INITIALIZE SYMBIONT FILE AREAS '                             
         SYSTEM   SIG9P                                                         
         SYSTEM   OPTIONS                                                       
*                                                                               
*                                                                               
        DO       #MAP                                                           
*                                                                               
*                                                                               
*                                                                               
*        CLEAR SYMBIONT AREAS OF ANY PARTIALLY PROCESSED FILES                  
*                                                                               
*                                                                               
         DEF      A:IPLSYM                                                      
         DEF      IPLSYM                                                        
         DEF      ISYMEXIT          EXIT FROM HERE                              
*                                                                               
*                                                                               
*                                                                               
OLAYFLAG EQU      'IPLS'  YM                                                    
         SYSTEM   CPRMON                                                        
         PAGE                                                                   
         SPACE    2                                                             
***********************************************************************         
*                                                                     *         
*        REGISTER USAGE:                                              *         
*                                                                               
*        R0       UNUSED BY THIS ROUTINE                                        
*        R1       WORK REG FOR LOOP, INDICIES, ETC.                             
*        R2       HALF WORD INDEX INTO FILE NAME TABLE                          
*        R3       ADDRESS OF FILE NAME TABLE (CREATED BY THIS CODE)             
*        R4       NOT USED HERE                                                 
*        R5       INDEX FOR SEARCHING FILE DIRECTORIES                          
*        R6       INDEX TO NEXT FREE FILE NAME TABLE ENTRY                      
*        R7       TEMPSPACE POINTER                                             
*        R8       CAL ERROR CODE REGISTER, LINK TO SOME MONITOR SUBRS           
*                                   ALSO, LEFT HALF EVEN/ODD PAIR               
*        R9       DOUBLE WORD NAME TEMP                                         
*        R10,R11  NAME OF FILE PROCESSING,                                      
*        R12,R13  NAME OF FILE IN LOOK-UP, PARAM TO SMBCDHEX                    
*        R14      LINK TO INTERNAL SUBROUTINES, TEMP                            
*        R15      WORK REGISTER                                                 
*                                                                     *         
*                                                                     *         
***********************************************************************         
         PAGE                                                                   
         SPACE    1                                                             
***********************************************************************         
*                                                                     *         
*    FUNCTION:    CLEAN UP THE SYMBIONT INPUT AND OUTPUT AREAS                  
*                 OF PARTIALLY PROCESSED OR CREATED FILES.                      
*                                                                               
*    HOW:         THE IS (OS) DIRECTORY IS READ INTO THE DIRECTORY              
*                 BUFFER AND A SEARCH MADE FOR ALL ALOCATED FILES               
*                 (ACTUALLY, FILE EXTENSIONS).  AS EACH EXTENSION IS            
*                 FOUND, ITS JOB NUMBER PORTION - YYXXX - IS LOOKED             
*                 UP IN THE TABLE AT TABLBEGN.  THE FILE EXTENSION              
*                 NAME IS ENTERED AT THE END IF NO MATCH IS FOUND.              
*                   THEN, THE TABLE'S ENTRY IS TESTED FOR AN EXTENSION          
*                 NUMBER OF TRUE ZERO, INDICATING A DELETED JOB FILE.           
*                 IF IT IS ZERO, THE NEXT DIRECTORY ENTRY IS TESTED.            
*                   IF NOT ZERO, THE LENGTH OF THE CURRENT EXTENSION            
*                 IS TESTED FOR ZERO LENGTH.  IF THE LENGTH IS ZERO,            
*                 FILES WITH THIS JOB NUMBER ARE DELETED VIA THE JOB            
*                 DELETE CAL AND THE TABLE ENTRY MARKED DELETED AS              
*                 ABOVE. THE NEXT DIRECTORY ENTRY IS THEN TESTED.               
*                   FINALLY, THE CURRENT EXTENSION IS TESTED FOR THE            
*                 EXTENSION NUMBER 00, C'00', AND THIS ENTERED IN THE           
*                 TABLE'S EXTENSION NUMBER IF SO TO MARK THAT THE BEGIN         
*                 OF THE FILE HAS BEEN FOUND.                                   
*                                                                               
*                 WHEN THE ENTIRE DIRECTORY HAS BEEN SEARCHED, THE              
*                 THE 'TABLBEGN' TABLE IS SEARCHED FOR ENTRIES THAT DO          
*                 NOT HAVE A C'00' AS THEIR EXTENSION NUMBER AND ANY            
*                 SUCH FILES DELETED VIA THE JOB DELETE CAL.                    
*                                                                               
*                   THIS LEAVES ONLY FILES THAT HAVE AN EXTENSION 00            
*                 AND HAD NO PARTIALLY PROCESSED EXTENSIONS.                    
         PAGE                                                                   
         SPACE    2                                                             
***********************************************************************         
*                                                                     *         
*                                                                               
*    SEVERAL CHECKS ARE MADE ON THE VALIDITY OF THE DIRECTORIES:                
*                                                                               
*        1        THE AREAS MUST BE ALLOCATED                                   
*        2        THE LENGTH PART OF THE FIRST WORD OF A DIRECTORY              
*                 BLOCK MUST BE LESS THAN OR EQUAL TO THE MASTD GIVEN           
*                 LENGTH OF A SECTOR.                                           
*        3        THE LINK SECTOR ADDRESS OF A CONTINUED DIRECTORY              
*                 MUST BE LESS THAN THE  'EOT'  SECTOR AS GOTTEN                
*                 FROM MASTD.                                                   
*        4        THE START AND END SECTOR NUMBERS OF EACH EXTENSION            
*                 FILE MUST BE LESS THAN THE  EOT  SECTOR.                      
*        5        THE END SECTOR OF SUCH A FILE MUST NOT BE LESS THAN           
*                 THE START SECTOR.                                             
*                                                                               
***********************************************************************         
         PAGE                                                                   
         SPACE    2                                                             
A:IPLSYM EQU      %         START OF PROCESSING                                 
IPLSYM   EQU      A:IPLSYM                                                      
         SPACE    2                                                             
       DO       #SYMB    CLEAR 'IS', 'OS' AREAS OF PARTIAL FILES                
*                                                                               
*        LINK:    R14                                                           
*        RETURN:  R14,  THERE ARE NO ERROR RETURNS                              
         SPACE    2                                                             
ISYM     EQU      %         START CLEAN-UP OF SYMBIONT AREAS                    
         PUSH     R14               SAVE RETURN ADDRESS LINK                    
         LI,R7    SIZETS+1          GET SIZE OF TEMP SPACE NEEDED               
         BAL,R8   GETTEMP           AND GET IT                                  
         BAL,R14  ISYMCRS             ERROR IF NONE                             
*                                                                               
         ENABLE                                                                 
         LW,R8    R7                SAVE POINTER                                
         AND,R7   M24               AND REMOVE FLAGS FROM ADDRESS               
         LI,R1    SIZETS            MOVE THE FPTS TO THE SPACE                  
*                                                                               
ISYM1    EQU      %                                                             
         LW,R15   ISYMFPTS,R1                                                   
         STW,R15  *R7,R1                                                        
         BDR,R1   ISYM1             LOOP FOR MOST OF IT                         
*                                                                               
         STW,R8   TSPACE,R7         AND SAVE THE TSPACE WORD                    
         LW,R6    R7                COPY ADDRESS OF TEMP SPACE                  
*                                                                               
*                                                                               
*                                                                               
         AWM,R7   READFPT,R7        FIX ADDRESS OF DCB IN THE FPTS              
         AWM,R7   WRITEFPT,R7                                                   
         AWM,R7   CLOSEFPT,R7                                                   
         AWM,R7   MSGADD,R7         AND ADDRESS OF THE ERROR MSG                
*                                                                               
*                                                                               
*                                                                               
         LI,R7    255               SET SIZE OF A DIRECTORY BLOCK               
         BAL,R8   GETTEMP           GET A BUFFER FOR THE DIRE                   
         BAL,R14  ISYMCRS             UNABLE TO, ERROR                          
*                                                                               
         STW,R7   BB1,R6            SAVE CONTROL WORD FOR LATER RELEASE         
         AND,R7   M24                                                           
         STW,R7   DIREBEGN,R6       SAVE AND SET AS READ ADDRESS                
         STW,R7   READBUFF,R6       AND ADDRESS OF THE DIRECTORY                
*                                                                               
         LI,R7    255               SET TABLE SIZE = MAX = 128 ENTRIES          
         BAL,R8   GETTEMP           GET A BLOCK OF SPACE                        
         BAL,R14  ISYMCRS             NONE, SO GIVE AN ERROR                    
*                                                                               
*                                                                               
         STW,R7   BB2,R6            SAVE THIS TOO                               
         AND,R7   M24                                                           
         STW,R7   TABLBEGN,R6       AS THE START OF THE TABLE                   
         STW,R7   R3                ALSO SAVE FOR EASIER ACCESSING              
         AI,R7    -2                ALSO COMPUTE ADDRESS OF ENTRY               
         STW,R7   TABLM2,R6         MINUS ONE                                   
         LW,R7    R6                COPY ADDRESS OF TSPACE                      
         ENABLE                                                                 
         PAGE                                                                   
         SPACE    2                                                             
ISYMA    EQU      %         FIND IF THERE IS AN AREA TO CLEAN UP                
         LW,R8    SYMAREA,R7        COPY NAME TO LOOK UP                        
         BAL,R5   FMMASTX           TEST IF THERE, GET INDEX                    
         B        ISYMP               NO, TEST IF DONE                          
*                                                                               
*                          MASTER DICTIONARY INDEX IS LOADED IN R6              
*                                                                               
         LI,R1    DCB               COMPUTE ADDRESS OF THE DCB                  
         AW,R1    R7                AND                                         
         LI,R5    6                 POINT AT AREA INDEX FIELD IN IT             
         STB,R6   *R1,R5            FIX DCB TO POINT AT THE AREA                
         LB,R5    MDDISCI,R6        GET POINTER TO DISC TABLES AND              
         LH,R15   DISCNWPS,R5       GET WORDS PER SECTOR FOR DISC               
         SLS,R15  2                 CONVERT TO BYTES PER SECTOR                 
         STW,R15  BYTECNT,R7        AND SET AS BYTES TO READ IN FPT             
         LW,R15   MDEOA,R6          COMPUTE AREA RELATIVE END SECTOR            
         SW,R15   MDBOA,R6          AND SAVE FOR CHECKING SECTOR                
         STW,R15  AREAEND,R7        ADDRESSES WITHIN THE DIRECTORIES            
         LI,R6    0                 SET NO ENTRIES IN FILENAME TABLE YET        
         STW,R6   READKEY,R7        YET; AND START READ AT AREA SECTOR 0        
         STW,R6   #FILES,R7         AND SET NO FILES LEFT IN DIRECTORY          
         PAGE                                                                   
*                                                                               
*        REGISTERS:                                                             
*                                                                               
*        R7       POINTER TO TSPACE WITH FPT'S, DCB'S (SEE ISYMFPTS)            
*        R6       INDEX TO NEXT FREE FILENAME TABLE ENTRY                       
*        R3       ADDRESS OF START OF FILENAME TABLE                            
*                                                                               
*                                                                               
*                                                                               
ISYMB    EQU      %         READ NEXT (FIRST) SECTOR OF DIRECTORY               
         CAL1,1   READFPT,R7        READ IT IN                                  
         CAL1,1   CLOSEFPT,R7       CLOSE DCB SO DELETES WILL WORK              
*                                   IF A FILE MUST BE DELETED                   
         LW,R1    DIREBEGN,R7       IS THE DIRE ALLOCATED ?                     
         LW,R15   DIREINFO,R1       (IE, NOT CLEARED TO ALL ZEROS ? )           
         BEZ      ISYMN               NO, END OF DIRE READ                      
*                                                                               
         LCI      2                 VALIDATE DIRECTORY IDENTIFICATION           
         LM,R10   DIREIDW1,R1       WORDS                                       
         CD,R10   DIRECODE          TO INSURE A DIRE IS THERE                   
         BNE      ISYMZZ              INVALID: CLEAR AREA                       
*                                                                               
         AND,R15  M17               REMOVE ANY 'CONTINUED' FLAG                 
         AW,R15   DIREBEGN,R7       AND SET LAST+1 USED WORD IN DIRE            
         LI,R5    DIRELHDR          SET INDEX TO 1ST POSSIBLE ENTRY             
         AW,R5    DIREBEGN,R7                                                   
*                                                                               
ISYMC    RES      0         TEST NEXT ENTRY                                     
         CW,R5    R15               PROCESSED LAST ENTRY THIS SECTOR?           
         BGE      ISYMJ               YES, TEST IF MORE SECTORS                 
*                                                                               
         LW,R10   DIRENAM1,R5       GET FILENAME FROM ENTRY                     
         LW,R11   DIRENAM2,R5                                                   
         CD,R10   ZEROS                                                         
         BE       ISYMD             IF DELETED SKIP IT                          
*                                                                               
         CI,R10   -1                A BAD TRACK ENTRY?                          
         BE       ISYMH               YES, SKIP IT AND MARK ENTRY THERE         
*                                                                               
         LW,R8    DIREBOT,R5        GET BOT AND EOT AND VERIFY THEM FOR         
         LW,R9    DIREEOT,R5        REASONABLENESS                              
         CW,R8    R9                START SECTOR =< END SECTOR ?                
         BG       ISYMZZ              NO, ERROR                                 
         CW,R8    AREAEND,R7        START OK ?                                  
         BG       ISYMZZ              NO, SKIP OUT                              
         CW,R9    AREAEND,R7        END OK ?                                    
         BG       ISYMZZ              NO, AGAIN QUIT                            
*                                                                               
         LI,R4    SIZE:T1           VERIFY PREFIX. IT MUST BE                   
         LH,R12   R10               'BF', 'CR', OR 'LP' TO BE VALID             
         CH,R12   T:ISYM1,R4        IS IT A LEGAL NAME ?                        
         BE       ISYMC3              YES, VALID FILE                           
         BDR,R4   %-2                                                           
         B        ISYMZZ            BAD FILENAME: ZAP DIRECTORY                 
*                                                                               
ISYMC3   RES      0                                                             
         LD,R12   R10               COPY NAME TO GET ID NUMBER                  
         SLD,R12  -24               RIGHT JUSTIFY IT AND GET THE 3              
         AND,R13  M24               DIGTS                                       
         LI,R4    3                                                             
         BAL,R8   SMBCDHEX          CONVERT TO NUMERIC                          
         CW,R14   MAXID#,R7         THIS THE LARGEST ID FOUND SO FAR?           
         BLE      %+2                 NO, KEEP CURRENT LARGEST                  
         STW,R14  MAXID#,R7          YES, SET NEW LARGEST                       
         PAGE                                                                   
*                                                                               
*                                                                               
*                           LOOK NAME UP IN TABLE                               
         LW,R1    R6                COPY NUMBER IN TABLE TO TEST                
         BEZ      ISYMF               HANDLE THE ZERO CASE                      
         LD,R8    R10               COPY NAME LOOKING FOR                       
         AND,R9   YFFFF             REMOVE LAST 2 CHARACTERS                    
         LW,R0    TABLM2,R7         GET ADDRESS OF TABLE - 2                    
*                                                                               
ISYME    EQU      %         TEST EACH TABLE ENTRY FOR ONE IN R8,9               
         LD,R12   *R0,R1            FETCH A TABLE ENTRY                         
         AND,R13  YFFFF             REMOVE CODE INFO                            
         CD,R8    R12               IS THIS THE ENTRY?                          
         BE       ISYMG               YES, FOUND                                
         BDR,R1   ISYME               NO, MORE TO LOOK AT?                      
*                                                                               
ISYMF    EQU      %         NOT IN TABLE; ADD IT AT END                         
         CI,R6    128               IS THE TABLE FULL NOW ?                     
         BGE      ISYMZZ              YES, NO ROOM. ZAP DIRE                    
*                                                                               
         STD,R10  *R3,R6            STORE AT FIRST FREE ENTRY                   
         AI,R6    1                 STEP LENGTH TO INCLUDE NEW ONE              
*                                                                               
         LW,R1    R6                SET LOC OF NEW ENTRY                        
*                                                                               
ISYMG    EQU      %         FILENAME FOUND IN TABLE:                            
         AI,R1    -1                ADJUST INDEX FOR ZEROTH ENTEY               
         LW,R2    R1                COPY TABLE ENTRY INDEX AND CONVERT          
         SLS,R2   2                 IT TO A HALF WORD INDEX FOR THE             
         AI,R2    3                 EXTENSION NUMBER                            
         LH,R14   *R3,R2            GET EXTENSION NUMBER                        
         BEZ      ISYMD             DELETED?  YES, DONE WITH IT                 
*                                                                               
         LW,R14   DIREFSIZ,R5       IS FILE LENGTH = 0 ?                        
         BEZ      ISYMI               YES, DELETE ASSOCIATED FILES              
         LI,R9    X'FFFF'           GET EXTENSION NUMBER OF FILE                
         AND,R9   R11               TO TEST IF IT IS EXTN 00,                   
         CI,R9    C'00'  X'F0F0'    BEGINNING OF THE FILE?                      
         BNE      ISYMD               NO, JUST A PART OF EXTENSIONS             
*                                                                               
         STH,R9   *R3,R2              YES, SET START EXTN FOUND                 
         B        ISYMD             AND TEST NEXT DIRE ENTRY                    
*                                                                               
ISYMH    RES      0         BADTRACK ENTRY PRESENT: MARK DIRE NEEDED            
         MTW,+1   #FILES,R7         ENTRY IN DIRE NEEDED                        
         B        ISYMD             STEP TO NEXT                                
*                                                                               
*                                                                               
ISYMI    EQU      %         DELETE ALL FILES THIS FILE'S JOB NUMBER             
         BAL,R9   ISYMXX            DELETE IT                                   
         B        ISYMD             AND LOOP FOR NEXT FILE IN DIRE              
*                                                                               
*                                                                               
ISYMD    RES      0         GET LENGTH OF ENTRY AND STEP TO NEXT                
         LW,R10   DIRELEN,R5        GET FLAG/LENGTH WORD                        
         AND,R10  XFF               EXTRACT IT                                  
         AW,R5    R10               STEP TO POINT AT NEXT ENTRY                 
         B        ISYMC             AND GO TEST IF DONE WITH SECTOR             
*                                                                               
*                                                                               
ISYMJ    EQU      %         END OF SECTOR; ANOTHER SECTOR  TO PROCESS           
         LW,R5    DIREBEGN,R7       POINT AT START OF DIRE SECTOR AGAIN         
         LW,R14   DIREINFO,R5       WAS THIS THE LAST DIRE SECTOR ?             
         BGEZ     ISYMK               YES, DO CLEAN UP                          
*                                                                               
         LW,R14   DIRENEXT,R5       GET LINK TO NEXT DIRECTORY SECTOR           
         CW,R14   AREAEND,R7        IS LINK OUT OF THE AREA'S LIMITS ?          
         BG       ISYMZZ              YES, LEAVE MESS THERE, EXIT HERE          
*                                                                               
         STW,R14  READKEY,R7        SET SECTOR ADDRESS TO READ                  
         B        ISYMB             READ NEXT SECTOR AND PROCESS                
         PAGE                                                                   
*                                                                               
*                                                                               
*                                                                               
ISYMK    EQU      %         SEARCH FOR PARTIAL FILES.                           
*                                   THEY HAVE NO HEAD (EXTN 00) FOUND           
*                                   AND ARE NOT YET DELETED FROM TABLE.         
         LI,R1    0-1               POINT AT TABLE ENTRIES; DOUBLE WORD         
         LI,R2    3-4               HALF WORD INDICIES;  = ENTRY -1             
*                                                                               
*                                                                               
ISYML    EQU      %         STEP TO NEXT (FIRST)                                
         AI,R1    1                 NEXT ENTRY                                  
         AI,R2    4                 NEXT EXTENSION NUMBER                       
         CW,R1    R6                AT THE END YET ?                            
         BGE      ISYMN               YES, FINISH UP                            
*                                                                               
         LH,R8    *R3,R2            GET THE EXTENSION NUMBER                    
         BEZ      ISYML             DELETED;  STEP TO NEXT                      
         AND,R8   M16                                                           
         CI,R8    C'00'   X'F0F0'   START EXTENSION?                            
         BE       ISYMM               YES, OK TO KEEP                           
*                                                                               
         BAL,R9   ISYMXX            DELETE THE FILE                             
         B        ISYML             AND GET NEXT                                
*                                                                               
ISYMM    RES      0         AN ENTRY WILL REMAIN IN THE DIRE                    
         MTW,+1   #FILES,R7         STEP COUNT OF FILES LEFT IN DIRE            
         B        ISYML             AND GET NEXT                                
*                                                                               
*                                                                               
ISYMN    EQU      %                 END OF PROCESSING; CLEAN UP                 
         LW,R14   DCB,R7            WAS THE DCB EVER OPENED ?                   
         CW,R14   Y002              I.E., IS OPEN FLAG SET ?                    
         BAZ      ISYMP               NO, TEST IF ALL DONE                      
*                                                                               
         MTW,+00  #FILES,R7         ARE THERE ANY ENTRIES LEFT IN DIRE?         
         BNEZ     ISYMO               YES, DO NOT CLEAR DIRE                    
*                                                                               
         CAL1,1   WRITEFPT,R7       NO ENTRIES: REINITIALIZE DIRE               
*                                                                               
ISYMO    RES      0         CLEAN UP                                            
*                                                                               
         CAL1,1   CLOSEFPT,R7       INSURE DCB IS CLOSED                        
*                                                                               
ISYMP    EQU      %         INSURE BOTH 'IS' AND 'OS' ARE PROCESSED             
         LI,R1    KOS               WAS THIS THE 'OS' AREA JUST                 
         CW,R1    SYMAREA,R7        PROCESSED?                                  
         BE       ISYMZ               YES, CLEAN UP AND EXIT                    
*                                                                               
         STW,R1   SYMAREA,R7        NO, SET TO PROCESS 'OS' AREA                
         B        ISYMA             AND PROCESS IT                              
*                                                                               
*                                                                               
*                                                                               
ISYMZ    EQU      %         END OF INIT;  CLEAN UP OUR TEMP STUFF               
         LW,R14   MAXID#,R7         WERE ANY FILES FOUND ?                      
         BLZ      ISYM8               NO, LEAVE SYMB AS IS                      
*                                                                               
         AI,R14   1                 ELSE SET TO NEXT FREE ID NUMBER             
         STH,R14  SYMB              AS NEXT TO BE ASSIGNED                      
*                                                                               
ISYM8    EQU      %         RELEASE TEMP SPACE                                  
         LW,R6    R7                COPY ADDRESS OF TEMPS, ETC                  
         LW,R7    BB2,R6            RELEASE OTHER TEMP SPACE                    
         BAL,R8   RELTEMP                                                       
*                                                                               
         LW,R7    BB1,R6                                                        
         BAL,R8   RELTEMP                                                       
*                                                                               
         LW,R7    TSPACE,R6                                                     
         BAL,R8   RELTEMP                                                       
*                                                                               
         ENABLE                                                                 
         PULL     R14               RECOVER RETURN ADDRESS                      
ISYMEXIT B        *R14              AND GET THE HECK OUT OF HERE                
*                                                                               
*                                                                               
*                                                                               
ISYMZZ   EQU      %         ERROR OF SOME SORT IN DIRE                          
         LW,R1    SYMAREA,R7        MOVE AREA NAME                              
         LI,R8    BADAREA           COMPUTE ADDRESS OF INSERT IN                
         AW,R8    R7                THE MESSAGE                                 
         STH,R1   *R8               AND INSERT THE AREA NAME                    
         CAL1,1   WRITEFPT,R7       ZERO THE DIRECTORY SECTOR                   
         CAL1,2   NAMERR,R7         TYPE MESSAGE                                
         B        ISYMO             CLOSE DCB AND PROCESS NEXT AREA             
*                                                                               
         PAGE                                                                   
*                                                                               
*                                                                               
ISYMXX   EQU      %         DELETE ALL FILES ASSOCIATED WITH FILE               
*                                   IN TABLE AT INDEX (R1)                      
*                                   (R2) IS INDEX TO EXTENSION NUMBER           
*                                   FIELD. (THIS IS ALSO THE STATUS OF          
*                                   THE FILE.                                   
*                                   '00'  ==> EXTENSION 00 FOUND                
*                                   0000  ==> FILE DELETED                      
*                                    NN   ==> FILE IN DIRE, NEITHER             
*                                             DELETED OR OK           )         
*                                                                               
         LD,R12   *R3,R1            GET NAME OF FILES TO DELETE                 
         SLD,R12  -24               RIGHT JUSTIFY JOB NUMBER                    
         AND,R13  M24               AND REMOVE EXTRA CHARACTERS                 
         LI,R4    3                 SET 3 CHARACTERS TO CONVERT ONLY            
         BAL,R8   SMBCDHEX          CONVERT TO NUMERIC HEX VALUE                
         STW,R14  JOBNUM,R7         AND SET IN FPT                              
         CAL1,7   JOBCAL,R7         DELETE ALL FILES WITH THIS JOB#             
         LI,R14   0                 SET THE FILES DELETED                       
         STH,R14  *R3,R2                                                        
         B        *R9               AND RETURN                                  
         PAGE                                                                   
*                                                                               
*                                                                               
*                                                                               
*                                                                               
ISYMERR  EQU      %                 ERROR OR ABNORMAL FROM CALS                 
         LW,R13   R10               COPY ERROR CODE FROM CAL                    
         BAL,R8   SMHEXBCD          CONVERT TO EBCDIC GRAPHICS                  
         LCI      2                                                             
         STM,R12  ISERRMSG+2        STORE IN MESSAGE                            
ISERRMSG CRASH    '   XXXXXXXX CODE FROM JOB DELETE CAL'                        
*                                                                               
*                                                                               
ISYMCRS  EQU      %         FATAL ERROR IN INITIALIZATION                       
*                                   R14 HAS ADDR +2 OF ROUTINE CALL             
         CRASH    'FATAL ERROR IN SYMBIONT INITIALIZATION'                      
*                                                                               
*   TABLE OF LEGAL PREFIXES FOR SYMBIONT AREA FILE NAMES                        
*                                                                               
T:ISYM1  RES      0                                                             
         DATA,2   0                                                             
         DATA,2   'BF'                                                          
         DATA,2   'CR'                                                          
         DATA,2   'LP'                                                          
SIZE:T1  EQU      HA(%)-HA(T:ISYM1)-1 SIZE OF T:ISYM1 TABLE                     
         BOUND    4                                                             
         PAGE                                                                   
         BOUND    4                                                             
         SPACE    2                                                             
ISYMFPTS EQU      %         BASE OF TEMP SPACE INFO DATA PSECT                  
*                                                                               
*                                                                               
ISTSPACE DATA        0              TEMP SPACE CONTROL WORD                     
ISBB1    DATA        0              BB1 CONTROL WORD                            
ISBB2    DATA        0              BB2 CONTROL WORD                            
ISAREAND DATA        0              RELATIVE END SECTOR OF AREA                 
ISDIRE   DATA        0              ADDRESS OF START OF DIRECTORY               
ISTABL   DATA        0              START ADDRESS OF FILE NAME TABLE            
ISTABLM2 DATA        0              SAME ADDRESS - 2                            
ISMAXID# DATA        -1             NO FILES FOUND/ LAST ID NUM FOUND           
IS#FILES DATA     0                 #FILES REMAINING IN PROCESSES DIRE          
*                                                                               
ISYMAREA GEN,16,16   0,KIS          NAME OF AREA TO PROCESS FIRST               
*                                                                               
*                                                                               
ISDCB    GEN,8,24    7,1                                                        
         GEN,8,16,8  3,0,0                                                      
ISBUFFER DATA        0              BUFFER TO READ DIRE INTO                    
         GEN,15,17   X'7FFF',ISYMERR    ERROR ROUTINE                           
         DATA        ISYMERR            ABNORM ROUTINE                          
         DATA        0,0            FILE NAME                                   
*                                                                               
*                                                                               
ISCLSDCB GEN,8,24    X'15',DCB      CLOSE THE DCB FPT                           
         GEN,2,30    3,0                                                        
         DATA        ISYMERR                                                    
         DATA        ISYMERR                                                    
         PAGE                                                                   
*                                                                               
*                                                                               
*                                                                               
ISREAD   GEN,8,24   X'10',DCB       READ A BLOCK OF THE DIRECTORY               
         DATA       P1+P2+P4+P8+F3+F7                                           
         DATA       ISYMERR                                                     
         DATA       ISYMERR                                                     
ISREAD#  DATA       0               BYTE COUNT TO READ                          
ISREDKEY DATA       0               READ KEY                                    
*                                                                               
*                                                                               
*                                                                               
ISWRITE  GEN,8,24 X'11',DCB         FPT TO ZERO A DIRECTORY SECTOR              
         DATA     P1+P2+P3+P4+P8+F3                                             
         DATA     ISYMERR           ERROR ADDRESS                               
         DATA     ISYMERR           ABNORMAL ADDRESS                            
         DATA     ZEROS             BUFFER ADDRESS                              
         DATA     1                 BYTE COUNT                                  
         DATA     0                 KEY (GRANULE #)                             
*                                                                               
*                                                                               
*                                                                               
ISJOBCAL GEN,8,1,23  X'67',1,0      JOB CAL FPT; DELETE FILES                   
         DATA        P1+P5+F2+F3+F7   DELETE ALL FILES IN SYM AREAS             
         DATA        ISYMERR                                                    
ISJOBNUM DATA        0              JOB NUM TO DELETE FILLED IN                 
*                                                                               
*                                                                               
ISNAMERR GEN,8,24   2,0             TYPE ERROR MESSAGE                          
         DATA     P1+F3             WAIT                                        
ISMSGADD DATA     NAMMSG            LOC OF MESSAGE                              
*                                                                               
ISNAMMSG TEXTC    '!! XX AREA DIRECTORY INCONSISTENCY ',;                       
                  '- AREA WAS CLEARED'                                          
*                                                                               
*                                                                               
*                                                                               
*                                                                               
*                                                                               
SIZETS   EQU      %-ISYMFPTS        SIZE OF TEMP SPACE NEEDED                   
         PAGE                                                                   
*                                                                               
*                                                                               
*                 OFFSETS INTO TEMPSPACE FOR THE FPTS AND FIELDS                
*                                                                               
*                                                                               
TSPACE   EQU      ISTSPACE-ISYMFPTS   TSPACE CTRL WORD, THIS AREA               
BB1      EQU      ISBB1-ISYMFPTS      TSPACE CTRL WORD, DIRE BUFFER             
BB2      EQU      ISBB2-ISYMFPTS      TSPACE CTRL WRD FOR TABLE                 
AREAEND  EQU      ISAREAND-ISYMFPTS   END SECTOR OF THE AREA                    
DIREBEGN EQU      ISDIRE-ISYMFPTS     BASE ADDRESS OF IS, OS DIRE               
TABLBEGN EQU      ISTABL-ISYMFPTS     START OF FILENAME TABLE                   
TABLM2   EQU      ISTABLM2-ISYMFPTS   TABLBEGN - 2                              
MAXID#   EQU      ISMAXID#-ISYMFPTS   HIGHEST JOB NUMBER FOUND IN DIRES         
#FILES   EQU      IS#FILES-ISYMFPTS   #FILES IN AREA AFTER CLEANUP              
*                                                                               
SYMAREA  EQU      ISYMAREA-ISYMFPTS   AREA BEING PROCESSED                      
DCB      EQU      ISDCB-ISYMFPTS      DCB                                       
READBUFF EQU      ISBUFFER-ISYMFPTS   WHERE TO READ A DIRE SECTOR               
*                                                                               
CLOSEFPT EQU      ISCLSDCB-ISYMFPTS   CLOSE THE DCB FPT                         
*                                                                               
READFPT  EQU      ISREAD-ISYMFPTS     READ A SECTOR OF THE DIRE                 
BYTECNT  EQU      ISREAD#-ISYMFPTS    DATA BYTE COUNT                           
READKEY  EQU      ISREDKEY-ISYMFPTS   SECTOR NUMBER TO READ                     
*                                                                               
WRITEFPT EQU      ISWRITE-ISYMFPTS    FPT TO ZERO DIRECTORY SECTOR              
JOBCAL   EQU      ISJOBCAL-ISYMFPTS   DELETE A JOB FPT                          
JOBNUM   EQU      ISJOBNUM-ISYMFPTS   JOB NUMBER TO DELETE                      
*                                                                               
NAMERR   EQU      ISNAMERR-ISYMFPTS   ERROR MSG TYPE FPT                        
MSGADD   EQU      ISMSGADD-ISYMFPTS   ADDRESS OF THE MESSAGE                    
NAMMSG   EQU      ISNAMMSG-ISYMFPTS   START OF THE MESSAGE                      
BADAREA  EQU      NAMMSG+1            NAME TO BE FILLED IN                      
         PAGE                                                                   
         SPACE    2                                                             
       ELSE     #SYMB                                                           
ISYMEXIT B        *R14              RETURN IF EVER GETS HERE                    
       FIN      #SYMB                                                           
         SPACE    2                                                             
         OLAYEND                                                                
        FIN      #MAP                                                           
         END                                                                    
