Link to USGS home page.
Coastal and Marine Geology Program

Skip menu and go to content. OFR 2005-1001 Home / Procedures / East-Coast Database / GIS Data Catalog

U.S. Geological Survey Open-File Report 2005-1001
USGS East-Coast Sediment Analysis: Procedures, Database, and GIS Data



radio button Quick BASIC Software

radio button - current selection C Language Software

radio button Visual BASIC Software

NAME: jsort


PURPOSE: To sort sediment analyses samples by lab number and retrieve complete sets which will be appended to the complete data set file.


SYNOPSIS: jsort file_name


DESCRIPTION:  This version of the program, which was written in “c” and compiled with DJGPP (v. 2.01), will run under Windows 95/98 in the Born-Again-Shell (Bash). The program jsort expects the input file to have a file-name suffix with “.dat”.  The “.dat” is not entered on the run line, but is used solely for file management purposes.  The input file is produced by combining or concatenating the raw data records from the GSANV, RSAM, CLTRM, and, through SEDITY2K, the RSA2000 and CLTRMS2K programs.  The input file is reorganized by 'pack' to contain one analysis type on only one physical record.  This 'packed' file is piped into a) a temporary file "jsortnn" where nn is the process_id; and, b) into the program 'dirct'.  A directory of which analyses were entered into the input file for each lab number is listed on the terminal.  The listing is piped through 'more'. The original data file “file_name.dat’ is left unaltered.  


Upon completion of the directory listing, the user is queried as to whether the file should be split.  This refers to retrieving complete data sets from the sorted temporary file. If the user responds 'y' to the prompt "Enter 'y' to split file:" the complete samples will be copied to a file 'file_name.fin’. If incomplete samples remain, an output file ('') will be created with only the incomplete samples.  If the file exists, the data are appended to the file. The samples will be sorted and contain only one physical record per analysis. 


The temporary file “jsortnn" will be purged from the system.


FILES: sedlab.h


SEE ALSO: backup, dirct, jsplit, sort, tee.


DIAGNOSTICS‑BUGS: In the program 'dirct' the line length is checked.  The program will abort when a packed line has become too large.  See MAXLINE of sedlab.h (2000 chars).


AUTHOR/MAINTENANCE: Janet J. Fredericks, Woods Hole Oceanographic Institute (WHOI), Woods Hole, MA 02543/Larry Poppe, U.S. Geological Survey (USGS), Woods Hole, MA 02543

skip menu

skip footer
U.S. Geological Survey
Coastal and Marine Geology Program
Woods Hole Science Center