In addition to quality, you can also store a separate integer notes array or character sting with each data value for version 7. If you store integer notes, the length of each note array must be the same for all values. If you store character strings, the strings can be of varying length, null terminated in the C code (but not in the Java code.) Typically, character strings are stored instead of integer notes, and they usually describe some attributes about the data. There are no length restrictions for quality or notes.
An example value for temperature using quality and notes might be:

72.4 3 "Sky partly cloudy with SW breeze"

Character strings are stored in TimeSeriesContainer cnotes[]. You must have a one-to-one correspondence for each data value and each note string. You can have empty note strings. The end of every note string is null terminated in the DSS file, so you cannot include other null characters in cnotes. You must have the same number of notes strings as data values (although note strings can be varying or zero length.)

The functions to set and get character note strings are:

public void setCharacterNotes(String characterNotes[]);
public String[] getCharacterNotes();
JAVA



Example: Time series data with multiple quality flags and character note strings


import javax.swing.UIManager;
import hec.heclib.dss.*;
import hec.heclib.util.HecTime;
import hec.heclib.util.HecTimeArray;
import hec.io.TimeSeriesContainer;

//  Regular interval time series data with multiple int quality flags and character notes 
public class ExampleTimeSeries8 {

	public static void main (String args[])  {
		
		try {
			javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception ignore) {}
		
		//  Write a regular interval data set.  Gen up the data
String alpha = "abcdefghijklmnopqrstuvwxyz";
		TimeSeriesContainer tsc = new TimeSeriesContainer();	
		tsc.setName("/Basin/Location/Flow//1Hour/Quality and Notes/");
		double values[] = new double[200];
		//  Use "quality7[][]" for multiple int quality flags.
		//  Cannot use both quality and quality7, as they both occupy the same space on disk. 
		int quality7[][] = new int[200][4];
		String cnotes[] = new String[200];
		for (int i=0; i<200; i++) {
			values[i] = (double)i;			
			int n = i/25;
			n = i - (n*25) + 1;
			cnotes[i] = alpha.substring(0, n);
			for (int j=0; j<4; j++) {
				quality7[i][j] = (i * 10) + j;
			}
		}
		tsc.setStartTime(new HecTime("20Jan2010", "2400"));	
		tsc.setValues(values);
		tsc.setQuality7(quality7);
		tsc.setCharacterNotes(cnotes);
		tsc.setUnits("CFS");
		tsc.setType("Inst-Val");
		
		HecTimeSeries dssTimeSeries = new HecTimeSeries();
		dssTimeSeries.setDSSFileName("C:/temp/Example7.dss");		
		int status = dssTimeSeries.write(tsc);
		dssTimeSeries.done();		
		if (status != 0) return;
		
		//  Read data
		TimeSeriesContainer tscRead = new TimeSeriesContainer();
		//  Note - implicit time window given using D and E parts.
		//  A time window must be provided and there are several alternatives for doing this
		tscRead.setName("/Basin/Location/Flow/01Jan2010/1Hour/Quality and Notes/");
		HecTimeSeries dssTimeSeriesRead = new HecTimeSeries();
		dssTimeSeriesRead.setDSSFileName("C:/temp/Example7.dss");		
		status = dssTimeSeriesRead.read(tscRead, true);
		dssTimeSeriesRead.done();		
		if (status != 0) return;
		double vals[] = tsc.getValues();
		HecTimeArray hTimes = tscRead.getTimes();
		String notes[] = tsc.getCharacterNotes();
		int qual[][] = tsc.getQuality7();
		//  Note - checking of items and lengths would be done here
		for (int i=0; i<vals.length; i++) {
			System.out.println("Ordinate: " + i + ", time: " + hTimes.element(i).dateAndTime() + 
					", value: " + vals[i] +  ", note: " + notes[i]);
			System.out.println("     Quality = " + qual[i][0] + ",  " + 
					qual[i][1] + ",  " + qual[i][2] + ",  " + qual[i][3]);
		}
		HecDataManager.closeAllFiles();
	}
}

JAVA


Ordinate: 0, time: 20 January 2010, 24:00, value: 0.0, note: a
     Quality = 0,  1,  2,  3
Ordinate: 1, time: 21 January 2010, 01:00, value: 1.0, note: ab
     Quality = 10,  11,  12,  13
Ordinate: 2, time: 21 January 2010, 02:00, value: 2.0, note: abc
     Quality = 20,  21,  22,  23
Ordinate: 3, time: 21 January 2010, 03:00, value: 3.0, note: abcd
     Quality = 30,  31,  32,  33
Ordinate: 4, time: 21 January 2010, 04:00, value: 4.0, note: abcde
     Quality = 40,  41,  42,  43
Ordinate: 5, time: 21 January 2010, 05:00, value: 5.0, note: abcdef
     Quality = 50,  51,  52,  53
Ordinate: 6, time: 21 January 2010, 06:00, value: 6.0, note: abcdefg
     Quality = 60,  61,  62,  63
...