TITLE:      FILESCAN1                            CG section:  3.1
                                                 doc #     :
                                                 date      :  790301
AUTHORS:    Jon Eschinger and Ruth Drozin        page      :  1

ABSTRACT
--------
    FILESCAN1 looks at the files at a site and determines their filetypes
(eg LOAD MODULE, FORTRAN source) and a number of other attributes.  By
default FILESCAN1 will process all files in the public file directory.
By option, an account, a range of accounts or a private volume may be
processed.  By option the number of records in each file will be
counted; otherwise the record count will be zero. Other options
allow the user to direct output to a specific file and to provide
a site identification number.  Multiple ACCOUNT, RANGE and PACK options
may be selected in a run. At the end of the run a summary of filetypes
will be printed. Information included in the summary is number of
files and number of granules for each filetype.
NOTES: A non-standard PCL is included with patches to allow
       a BATCH link to it, passing the PCL command through
       the CCBUF.  The file BUPCL can be copied over PCL.:SYS
       and DRSP'd, which works fine at some sites.  Others, however,
       seem to have a problem with our modified PCL and they have
       two other alternatives.  One is to change PROCLINK
       so that it links to BUPCL in the desired account and the
       other is to ensure that the patch is applied to their
       own version of PCL which makes linking to PCL work
       properly in batch. The GENMDs to do this are as follows:

         For the F00 version of PCL the patches are:

<<                                               .Rumsey LADC
<<  Make PCL look at CCBUF in batch.             .Rumsey LADC
<<  If CCBUF="PCL", enter non-TEL mode;          .Rumsey LADC
<<  otherwise, enter single-command TEL          .Rumsey LADC
<<  mode.                                        .Rumsey LADC
<<                                               .Rumsey LADC
,PCL+53,22400050(69300046+PCL)                   .Rumsey LADC
,PCL+56,68000048+PCL(68000046+PCL)               .Rumsey LADC

       The last access date of a file will not be updated by
       FILESCAN1. If you do not have the last access date
       patch in your system, you should consider adding it.

      SCAN1LMN must be run from an account with X'C0' privilege
      or greater as it reads passworded files and goes master mode.

LANGUAGE
--------

EXTENDED FORTRAN4 with AP subroutines

FORTRAN MODULES
---------------

MAIN               Initializes variables and calls subroutine
                   to validate input commands.

GETCOM             Calls routine to read a command. Identifies the
                   command. Calls the routines that process them.
                   At end-of-file calls the routines to see if
                   this should be a default run.

SITE               Processes the +SITE option and updates the output
                   buffer with the site identification.

COUNT              Processes the +COUNT option and updates the output
                   buffer and sets the COUNT indicator to 1.

OUTPUT             Processes the +OUTPUT command and sets the output
                   file name buffers to indicate the selected output
                   fid.


AKOUNT             Processes the +ACCOUNT option and sets up the
                   starting account buffers.

RANGE              Processes the +RANGE option and sets up the starting
                   and ending account numbers.

PACK               Processes the +PACK option and sets up the serial
                   number and starting account buffers.

CHKDEF             Called at end-of-option-file to see if a valid ,
                   +ACCOUNT, +RANGE or +PACK option has been processed.
                   If so it calls ENDIT; otherwise it sets up for a
                   default run.







TITLE:      FILESCAN1                            CG section:  3.1
                                                 doc #     :
                                                 date      :  790301
AUTHORS:    Jon Eschinger and Ruth Drozin        page      :  1

ENDIT              Prints the summary of the run, closes the output file
                   and exits.

RDCOM              Reads the options from F:105. Decects end-of-file and
                   any other errors.

GTFILE             Calls the routines that position at first file
                   to be processed, open next file and determine the
                   filetype. Also checks for change of account or
                   end of account directory. Calls routines to
                   add to the counters and to write the output
                   record. Also calls PCL to uncompress the first
                   50 records of a file.

WRTIT              Writes the output record.

MOVEIN             Puts the filetype code in the output buffer, closes
                   the processed file, calls the routine to write
                   the output record and adds to the counters.

CNTIT              Counts the records in a file.

AP MODULES
----------

MBS                Does a move byte string.

CBS                Does a compare byte string.

KOPEN              Opens output file as keyed, output.

KOPENIO            Opens file of filetype names and codes as
                   keyed, input.

KREAD              Reads a keyed record of the filetype names
                   file.

KCLOSES            Closes and saves the filetypes name file.

KWRITEN            Writes a keyed record in the output file.

PROCLINK           Links to PCL to uncompress files.

DCB01              Assigns filetypes name file to F:103.

METASCAN - ENTRY POINTS

FREEPG             Frees memory pages.

GETPG              Gets memory pages.

CLOS               Closes and saves processed file.

STARTUP            Determines first file to be processed.

NEXT               Opens next file to be processed.

RDFRST             Reads a record in the file being processed.






TITLE:      FILESCAN1                            CG section:  3.1
                                                 doc #     :
                                                 date      :  790301
AUTHORS:    Jon Eschinger and Ruth Drozin        page      :  1

DBTEST             Checks for EDMS/DMS databases, schemas, subschemas.
                   Also checks for APL workspaces and save me/

SPSS               Checks for SPSS workspaces.

LIBTST             Checks for :DIC/:LIB and LEMUR libraries.

FRTBIN             Checks for FORTRAN binary files.

ROMETC             Checks for ROMs, :BLIB
                   compressed and LOCCT files. Also BMD and
                   OSIRIS workspaces.

SHARED             Checks for shared libraries.

LMNTXT             Checks for LOAD MODULES, TEXT files,
                   MINITAB workspaces and MANAGE dictionaries.

PROCS

DCB ASSIGNMENTS
---------------

F:103              FILETYPES.960 - keyed, input
                   This is the file of filetype names and codes.

F:102              Output file. Keyed. Default is SCANDATA.:SYS.

F:110              DCB used to open and read files processed in
                   the FILESCAN1 run.

OUTPUT RECORD FORMAT
--------------------

BYTES      SIZE    TYPE        DESCRIPTION
-----      ----    ----        -----------

1-4        4       alpha       Site ID
5-8        4       alpha       Private volume SN
9-16       8       alpha       Account
17-47      31      alpha       Filename
48-49      2       alpha       Major filetype
50-51      2       alpha       Minor filetype
52-57      6       integer     # granules
58         1       alpha       Organization (R,K,C)
59-64      6       alpha       Create date
65-70      6       alpha       Modify date
71-76      6       alpha       Last access date
77-78      2       integer     Keymax
79         1       alpha       Compressed (Y/N)
80         1       alpha       Has JCL?(Y/N)
82         1       alpha       Binary, EBCDIC, both?(1,2,3)
83         1       alpha       Variable record length?(Y/N)
84-88      5       integer     Maximum record size
98-95      7       integer     # records
96-111     8*2     alpha       Multiple filetypes
112        1       alpha       Record count accurate (Y/N)






TITLE:      FILESCAN1                            CG section:  3.1
                                                 doc #     :
                                                 date      :  790301
AUTHORS:    Jon Eschinger and Ruth Drozin        page      :  1

JOB CONTROL COMMANDS TO LOAD
----------------------------
LYNX (J0)SCAN1BO,F:103BO,MBSBO,CBSBO,KEYIOBO,METABO,PROCLINK;
OVER SCAN1LMN

INPUT OPTIONS
-------------

+SITExxxxNAME OF SITE
    Where  xxxx is 4 character site id and NAME OF SITE is used
     on the summary output. Only one allowed per run.

+COUNT
    If used, FILESCAN1 will count the records in each file. Only
     one allowed per run.

+OUTPUTfid
    Where  fid  is the standard CP-V file identifier. Files may
     be output on public or private disc. Default fid is
     DC/SCANDATA.:SYS. Only one allowed per run.

NOTE:  ANY OF THE ABOVE OPTIONS MUST BE SPECIFIED BEFORE ANY OF
       THE FOLLOWING ONES. THOSE ABOVE MAY ONLY BE SPECIFIED ONE
       TIME. THOSE FOLLOWING MAY BE SPECIFIED MULTIPLE TIMES.

+ACCOUNTact
    Where  act  is a one to eight character account to be scanned.
     Only this account will be scanned.

+RANGEstart,end
     is the ending account.  Files in the starting and ending
     accounts will be scanned and all accounts in between.
     The comma (,) is required.

+PACKsn.act
    Where  sn  is the  serial number of the private volume and  act
     is the account of the pack.  The period (.) is required.

NOTE:  IF NONE OF THESE LAST THREE OPTIONS IS SELECTED, A DEFAULT
       RUN OF THE ENTIRE PUBLIC FILE SYSTEM WILL BE MADE.

