      SUBROUTINE FINDFL(IWGFIL)                                           00001 
C                                                                         00002 
C     THIS SUBROUTINE POSITIONS THE MAGTAPE TO                            00003 
C     THE PROPER SET OF IWGDE FILES.                                      00004 
C                                                                         00005 
C     THE FILE POSITION VARIABLES IN MTFCB COMMON ARE SET:                00006 
C     KTFILE = (6*(IWGFIL-1))+1                                           00007 
C     KTBLK = 0                                                           00008 
C                                                                         00009 
C     MAGERR (IN MTFCB COMMON) IS RETURNED .TRUE. IF                      00010 
C     PROBLEMS OCCURRED IN SKIPPING                                       00011 
C                                                                         00012 
C                                                                         00013 
C     EACH SET OF IWGDE FILES CONSISTS OF A LABELED                       00014 
C     FILE PAIR (DDF AND DF).                                             00015 
C     EACH LABELED FILE CONSISTS OF THREE FILES,                          00016 
C     THE HDRN LABELS AND EOF,                                            00017 
C     THE DATA FILE AND EOF                                               00018 
C     THE EOFN LABELS AND EOF.                                            00019 
C                                                                         00020 
C     IF THE REQUESTED IWGDE FILE IS NUMBER 1:                            00021 
C     THE TAPE IS ALREADY POSITIONED AND THERE IS                         00022 
C     NOTHING FOR THIS SUBROUTINE TO DO.                                  00023 
C                                                                         00024 
C     IF THE REQUESTED IWGDE FILE IS GREATER THAN                         00025 
C     ONE, THEN THE DESIRED FILE IS 6*(N-1) +1 AND                        00026 
C     THE NUMBER  OF FILES TO SKIP IS 6*(N-1).                            00027 
C                                                                         00028 
      INCLUDE 'SY:MTFCB.FTN'                                              00029 
      INCLUDE 'SY:MTCOMM.FTN'                                             00030 
      INCLUDE 'SY:FLGCM.FTN'                                              00031 
C                                                                         00032 
C                                                                         00033 
      IF (DEBUG) TYPE 50                                                  00034 
50    FORMAT(' FINDFL')                                                   00035 
C     SET FILE POSITION COUNTERS IN MTFCB COMMON                          00036 
      KTFILE= (6 * (IWGFIL -1)) +1                                        00037 
      KTBLK= 0                                                            00038 
      IF (DEBUG) TYPE 150,KTFILE,KTBLK                                    00039 
150   FORMAT(' ANSI FILE=',I3,' PHYSICAL RECORD=',I3)                     00040 
C                                                                         00041 
C                                                                         00042 
      MAGERR = .FALSE.                                                    00043 
C                                                                         00044 
      IF (IWGFIL .LE. 1) RETURN                                           00045 
C                                                                         00046 
      NSKIP = 6*(IWGFIL-1)                                                00047 
C                                                                         00048 
      IF (DEBUG) TYPE 250,NSKIP                                           00049 
250   FORMAT(' SKIPPING ',I3,' ANSI FILES.')                              00050 
      ASSIGN 32757 TO I32758                                              00051 
      GO TO 32758                                                         00051 
C                                                                         00052 
32757 IF (DEBUG .AND.  MAGERR) TYPE 350                                   00053 
350   FORMAT(' MAGERR=.TRUE. FROM FINDFL')                                00054 
      RETURN                                                              00055 
C                                                                         00056 
32758 CONTINUE                                                            00057 
      CALL MTSPF( MTLUN,NSKIP,ISTAT )                                     00058 
      IF(.NOT.( MTERRL )) GO TO 32756                                     00059 
      ASSIGN 32754 TO I32755                                              00059 
      GO TO 32755                                                         00059 
32754 CONTINUE                                                            00059 
32756 NSKIP = MTIOS(2)                                                    00060 
      GO TO I32758                                                        00061 
C     ERROR HANDLERS                                                      00062 
32755 CONTINUE                                                            00063 
      CALL ERROR( TTLUN,'SKIP MAGTAPE FILES FAILED',MTDSW,MTIOS )         00065 
      ASSIGN 32752 TO I32753                                              00066 
      GO TO 32753                                                         00066 
32752 GO TO I32755                                                        00067 
C                                                                         00068 
C                                                                         00069 
32753 CONTINUE                                                            00070 
      MAGERR = .TRUE.                                                     00071 
      GO TO I32753                                                        00072 
      END                                                                 00073 
