LABELS Instruction |
LABELS list of series
# "labels" and label expressions
LABELS attaches an output label to a series. RATS uses these output labels whenever it needs to display the name for a series. They are also used when you read data from a file that includes series names, including RATS, portable, and spreadsheet formats.
Parameters
list of series |
list of series to be given names or labels. |
Supplementary Card
The labels can be any collection of characters (up to sixteen) enclosed within single or double quotes. You can also use string expressions, LABEL variables, or elements of an array of LABELs.
Notes
The instruction EQV is similar, but goes beyond LABELS to attach a name which can also be used on input, to reference the series. LABELS is usually more appropriate, as labels aren’t subject to the restrictions put on symbolic names—you can use any combination of characters (up to sixteen). Note also, that any number of series can share an output label, while series names (set by EQV) must be unique.
Example
open data setup.dat
declare vector[label] pairs
read(varying) pairs
compute npairs=%rows(pairs)/2
open data ticker.rat
cal(d) 1988:1:5
allocate 2002:12:31
dec vector[series] tickseries(2)
do i=1,npairs
labels tickseries
# pairs(2*i-1) pairs(2*i)
data(format=rats) / tickseries
...
end do i
reads a (possibly very long) list of pairs of series names from the file SETUP.DAT. NPAIRS is the number of pairs read. The series are read, two at a time, from the RATS format file TICKER.RAT, and some (unspecified) analysis is performed. You need to use LABELS because DATA(FORMAT=RATS) searches for the data on the basis of the series labels.
Copyright © 2025 Thomas A. Doan