Coastal & Marine Geology InfoBank

Home FACS Activities Atlas Geology School Related Sites More

USGS InfoBank program -- howlong

Skip navigational links
Loading
InfoBank Programs: by Name   by Topic  
Expanded Description
Topic Description
Name
howlong
Synopsis
/infobank/programs/share/howlong.for
Description
  Subroutine to quickly estimate the number of records in a file.

       
ASSUMPTIONS
  Assumes all records are same length as the average of the first 

  ten records in file.
    
USAGE
  "a" = argument, "r" = referenced, "s" = set

  call howlong                          (with the following arguments)
         UnitNumber                  [variable i*4 r]
         NumberRecords               [variable i*4 sr]
    
SUBROUTINES
  stringlen           (shared DRS external routine) 

  getmode             (shared DRS external routine) 
    
FUNCTIONS
  attrib       (shared external macro) 

  fstat        (UNIX function)
    
FILES_USED
  unit=(d)unitnumber(read,inqre,bcksp)

  unit=*(write)
  unit=6(write)
    
NO_TAPES
  NOTE -- this subroutine will not work with foreign tapes. 

    
DISCLAIMER
  Although this program has been used by the U.S. Geological Survey,

  no warranty, expressed or implied, is made by the Survey as to the
  accuracy and functioning of the program and related program
  material nor shall the fact of distribution constitute any such
  warranty, and no responsibility is assured by the Survey in
  connection therewith.
    
AUTHORS
  Ed Maple & 

    Clint Steele     7/5/84  .for
  Ed Maple           8/8/84  Added code to set IntegerPercent to 1 if 
                             it equals 0 after calculations.  Will equal 
                             0 if the program calculates less than 50 
                             records in the file.
  Ed Maple          8/30/84  Added code to check for file size greater 
                             than 10000 records, and to print a message 
                             recommending running it batch if so. Only
                             checks if log_mode is interactive.
  Ed Maple           9/5/84  Added code to detect when subroutine is run 
                             from a batch job.
  Clint Steele       1/9/84  Replaced SPAWN with Attrib
  Clint Steele      2/12/85  Modified for MAT
  Ed Maple           5/2/85  Moved Attrib call outside of if-then 
                             statement so FileBlocks can be tested for 
                             a value of zero.  If it is zero then 
                             IntegerPercent is set to 100.
  Jean Riordan      2/11/88  Modified for DRS$SHARE cleanup and UNIX 
                             compatibility
  Clint Steele      9/23/88  Changed returned value from 1% to 100%.
                             Changed computation of record length
                             to average of 1st 10 records.
                             Changed i/o from unit * to 5 and 6.
  Clint Steele     11/23/88  Added recognition of BACKGROUND mode
  Clint Steele     11/23/88  Changed LOG_MODE to CALL GETMODE
  Clint Steele      8/15/91  Commented out "Next time...batch" message
  Clint Steele     12/4/95   Remvoed VMS references
  Carolyn Degnan    9/23/04  Added implicit none.

    
Reads
          read (UnitNumber, '(a)', iostat = Error, end = 101) Record
Writes
Opens
Calls
          call stringlen (Record, LengthRecord)
              call getmode (Mode)

Skip footer navigational links

Coastal and Marine Science Centers:  Pacific   St. Petersburg   Woods Hole  
InfoBank   Coastal and Marine Geology Program   Geologic Information   Ask-A-Geologist   USGS Disclaimer  


Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USA.gov logo U.S. Department of the Interior | U.S. Geological Survey
URL: http://walrus.wr.usgs.gov/infobank/programs/share/howlong.doc.html
Page Contact Information: InfoBank staff
Page Last Modified: Mon Sep 16 03:36:53 PDT 2013  (chd)