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

ABSTRACT
--------

    FILESCAN2 reads as input a file created by a run of FILESCAN1.
This file contains one record for each file encountered in a FILESCAN1
run.  See input section in this document for the record layout.
Summary information for each filetype is printed which consists of
number of files of that type, number of granules, number of records,
number of keyed, consecutive and random files, number of files which
were originally compressed or not, and the number which do and do not
have JCL embedded in them.  A summary of all filetypes contained in
mixed files (i.e. files containing more than one filetype) will be
printed. Also, for unidentified files, a count of those with and without
a variable key size and record size will be printed along with a count
of those containing binary or EBCDIC data or both.  By option one line
for each record in the input file will be printed. Information printed
is file name, account, number of granules, number of records, organ-
ization, create, modify and last access dates, keymax, maximum record
length, whether it was originally compressed and whether it has JCL.

    The input is always sorted by minor filetype within major
filetype.  One of four overriding sorts may optionally be selected.
The sorts are site-id, public/private disc, account and accurate/
not accurate record count.  If a sort option is used, an additional
parameter may be specified to select for processing only those
records with the sort key data field matching the parameter. For
example only records with the specified account will be processed.
When the sort option is selected, filetype sub-summaries will be
generated each time the value of the sort field changes. (eg. each
time there is a different account.) These sub-summaries are generated
in addition to the total summaries.

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

F:FILETYPE-NAMES                    Keyed, input
                                    assigned to the file containing the
                                    major and minor filetype names and
                                    codes.

F:INPUT-FILE                        Consecutive, input
                                    assigned to the file created by
                                    FILESCAN1.

F:SORT-FILE                         assigned to a file to be used by
                                    SORT.

F:INPUT-COMMANDS                    assigned to the card-reader. Used
                                    to read any selected options.

F:OUTPUT-REPORT                     assigned to the printer. This
                                    is the major part of the report.

F:SUMMARY-REPORT                    assigned to the printer. This prints
                                    some summaries in the report.






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

INPUT-FILE RECORD LAYOUT
------------------------

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)
81         1       alpha       Variable key size ?(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)

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

    There are two options that can be selected:

NOTE:  ONLY ONE OPTION OF EACH KIND MAY BE SELECTED.

+LIST           To generate one line of data for each record in the
                   input file.

+SORT           To sort the input file in various ways.

    +SORT (SITE)          Sort the input file be site id.
    +SORT (SITE,id)       Sort the input file by site id and process only
                            those records with the site id equal to id .
    +SORT (ACCOUNT)       Sort the input file by account.
    +SORT (ACCOUNT,act)   Sort the input file by account and only process
                            those records with an account equal to  act  .
    +SORT (PUBPRIV)       Sort the input file by public and private disc.
    +SORT (PUBPRIV,n)     Sort the input file by public and private disc
                            and process only those records with public
                            disc (n = 0) or private disc (n = 1).
    +SORT (COUNT)         Sort the input file by accurate or not-accurate
                            record count.
    +SORT (COUNT,n)       Sort the input file by accurate or not accurate
                            record count and process only those records with
                            accurate count (n = 0) or not accurate (n = 1).






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

LANGUAGE
--------

COBOL with REPORT WRITER, SORT and GETCOM.

PROGRAM DESCRIPTION
-------------------

    The input procedure opens as input FILETYPE-NAMES, INPUT-FILE
and INPUT-COMMANDS and as output OUTPUT-REOORT and SUMMARY-REPORT.
It then reads the input options, if any, and parses them to determine
the option selected.  If the option is +SORT, it determines which
field is to be sorted and sets SORTIND equal to 1 if the sort is by
site, to 2 if by account, to 3 if by public/private disc and to 4 if
by accurate/not accurate record count.  It also determines if there
is to be a selection of a site, account, public or private and accurate
or not accurate.  Then it reads the input file and, depending on the
sort option and any selection criterea, it constructs a sort key (first
eight bytes of the sort buffer) and releases the record to sort.

    In the output procedure, as each record is returned from sort,
a check is done to see if the sort field has changed.  If not, the filetype
is determined and the counters for that filetype are incremented and
another record is returned.  If the sort field has changed, the summary
lines are printed, the counters are initialized to zero and another
record is returned.  When all records have been returned, the final
summary lines are printed, files colsed and the run ends.

