Link to USGS home

checkstats

Name:
checkstats - Admin utility to check stored daily value statistics vs. processor setup for a given data descriptor

Information:

With the release of the new ADAPS data aging system in NWIS4.6 many users are finding errors like the following when trying to set data to "in-review" in setstatus:

Error 667 on operation "date chk"
in module "chk_db_consistency"
while checking DB Date consistency - found Computed UV dates younger than DVs for:
DD# X at STN USGS YYYYYYYY - Check Processor State Codes for consistency!

One of the primary causes of the that error is when there are daily value statistics (max, min, mean, etc.) stored for the DD that are not part of the current DD processor, either because they have been deleted from the processor but the DVs themselves have not, or because they are being computed as part of another processor setup. See the NWIS/OSW memo on this subject for more information: http://wwwnwis.er.usgs.gov/communications/2006news/061130Unit-Values.html

Checking the ADAPS Data Aging FAQ may also help:
http://wwwnwis.er.usgs.gov/currentdocs/adaps4_7faq.html#DATAA

This script facilitates a review of the DD that is given in the error message. The script will check the DV statistics available in the DD against the DV statistics set up with the processor. Although that will not necessarily provide the definitive answer to the problem behind the consistency error in setstatus, it can go a long toward helping.

Usage: checkstats [-z db_no] [-a agency_cd] -n site_no -d dd_nu -w water_yr

If -z is omitted, db_no defaults to 01
If -a is omitted, agency_cd defaults to "USGS"

Example output:

checkstats -n01010000 -d6 -w2004

For DD: USGS 01010000 6 00060, Water year 2004
Proc: 00001 00002 00003
  DV: 00001 00002 00003
Statistic lists match.

Installation:
This script is part of the OSW Scripts Installation package and should be installed as part of that package. Users needing the script outside of the package should send email to GS-W OSW Scripts@usgs.gov.

NWIS 5.00 OSW Scripts package installation instructions:
http://water.usgs.gov/usgs/osw/adaps/OSW_scripts_pkg.5.00.html

Script Language:
ksh

Original Author(s): Scott Bartholoma, NWIS

Note the original author is noted on this page for the purposes of giving credit only. Please address questions/comments to OSW (GS-W OSW Scripts@usgs.gov).

Latest Version Release Notes:

Version 5.00: Included as part of OSW Scripts package for NWIS 5.00+
-updated for NWIS 5.00+ releases (not compatible with NWIS 4.11 or prior)

Back to Scripts
[an error occurred while processing this directive]