[HLP:COUNT.HLP  9-Nov-78  R. Lordi , 28-May-80  A. Rafieymehr]  v.1

     THE COUNT PROGRAM COUNTS CHARACTERS, LINES, AND PAGES IN AN
ASCII FILE.  IT ALSO DETERMINES THE LENGTH OF THE LONGEST LINE IN
THE FILE.  TO INVOKE THE PROGRAM:
        .R COUNT

THE PROGRAM PROMPTS WITH
        INPUT FILE:
TO WHICH YOU CAN TYPE A FULL FILE SPECIFICATION IN THE FORM
      DEV:FILE.EXT[PPN]        OR       DEV:[PPN]FILE.EXT

 WHERE [PPN] CAN BE ONE OF:
         [PROJ#,PROG#]
         [PROJ#,PROG#,SFD]
         [PROJ#,,SFD]
         [,PROG#,SFD]
         [,,SFD]

IF DEV: IS OMITTED , DSK: IS ASSUMED AND IF [PPN] IS OMITTED ,[PPN] 
WHICH JOB IS LOGGED IN UNDER IS ASSUMED. IF EITHER PROJ# OR PROG# IS
OMITTED , THE PROGRAM USES PROJ# OR PROG# WHICH JOB IS LOGGED IN UNDER
FOR DEFAULT.

     AFTER THE PROGRAM HAS MADE A PASS THROUGH THE FILE, IT TYPES
A SUMMARY OF THE NUMBER OF CHARACTERS, LINES, AND PAGES IN THE FILE,
ALONG WITH THE LENGTH OF THE LONGEST LINE IN THE FILE.

     ONLY ASCII INPUT FILES ARE GUARANTEED TO GENERATE THE CORRECT
RESULTS.  SPECIFICALLY, THE PROGRAM DEFINES A LINE TO BE TERMINATED
BY A LINEFEED CHARACTER, AND A PAGE TO END EITHER ON A FORMFEED
CHARACTER OR AFTER 60 LINES.

     THE PROGRAM IS QUITE FAST.  MEASURED CPU TIME REQUIRED TO
PROCESS A 100 BLOCK FILE VARIES FROM 0.95 SECONDS FOR A
BEST-CASE FILE (ALL NULLS) TO 1.70 SECONDS FOR A WORST-CASE
FILE (ALL LINEFEEDS).

     ONE CAN MAKE SEVERAL USES OF THE COUNT PROGRAM.  IF ONE
IS SORTING AN ASCII FILE WITH VARIABLE LENGTH LINES, THEN THE
COUNT PROGRAM CAN SAVE SUBSEQUENT RUN-TIME FOR THE SORT BY
PROVIDING A VALUE FOR THE LONGEST LINE LENGTH (/R SWITCH IN SORT).
ONE CAN ALSO USE THE COUNT PROGRAM TO ESTIMATE ACCURATELY THE
NUMBER OF PAGES IN A PRINT REQUEST FOR THE /LIMIT SWITCH.

 NOTE:  JUST 1 LEVEL OF SFD IN FILE SPECIFICATION IS ALLOWED

[end HLP:COUNT.HLP]

.KJOB
.
