Skip to content

TSTool / Command / ReadStateCUB


Overview

The ReadStateCUB command reads time series from a StateCU binary output time series file. See the StateCUB Input Type Appendix. The actual reading occurs as the commands are being processed. For this reason and because the number of time series in the binary file is usually large, if any other commands reference the StateCU binary file time series, the time series identifiers must be specified manually or use wildcards in identifiers (identifiers are not available to list in dialogs). Only data types that contain floating point numbers are read.

Command Editor

The following dialog is used to edit the command and illustrates the syntax of the command.

ReadStateCUB

ReadStateCUB Command Editor (see also the full-size image)

Command Syntax

The command syntax is as follows:

ReadStateCUB(Parameter="Value",...)

Command Parameters

Parameter            Description Default                           
InputFile
required
The name of the StateCU binary time series file to read. The path to the file can be absolute or relative to the working directory. Can use ${Property} notation. None – must be specified.
TSID Time series identifier pattern to filter the read. Can use ${Property} notation. Read all time series.
InputStart The starting date/time to read data, specified to Month precision. Can use ${Property} notation. Read all data.
InputEnd The ending date/time to read data, specified to Month precision. Can use ${Property} notation. Read all data.
OutputVersion The file format version to be used for output:
  • Original - use the original format without translation
  • Latest - use the latest format (same as 14)
  • 14 - use StateCU version 14 format
This allows translating one binary file's contents to a different version, which is useful for automated testing and ensuring that processes work the same regardless of the input format. See the table below for details.
No translation occurs.

The following table lists translations that occur if OutputVersion is used.

OutputVersion Parameter Data Translations

OutputVersion Translations
14
Latest
  • Location identifier TO is changed to TOTAL.

Examples

See the automated tests.

The following example command file illustrates how to read all CU Shortage time series:

ReadStateCUB(InputFile="Data\farmers.BD1",TSID="*.*.CU Shortage.*.*")

The following example illustrates how to read all time series from a binary file with debug turned on to echo all information that is read.

StartLog(LogFile="commands.TSTool.log")
SetDebugLevel(LogFileLevel=1)
ReadStateCUB(InputFile="Data\farmers.BD1")

Troubleshooting

See Also