Valmap
Valmap (value map). Assigns descriptive labels to values in numeric or alpha series.
Valmap Declaration
To declare a valmap use the keyword valmap, followed by a name
valmap mymap
Valmap Views
label label information for the valmap object.
sheet view table of map definitions.
stats summary of map definitions.
usage list of series and alphas which use the map.
Valmap Procs
append append a definition to a valmap.
clearhist clear the contents of the history attribute.
copy creates a copy of the valmap.
olepush push updates to OLE linked objects in open applications.
setattr set the value of an object attribute.
Valmap Data Members
String values
@attr("arg") string containing the value of the arg attribute, where the argument is specified as a quoted string.
@description string containing the Valmap object’s description (if available).
@detailedtype string with the object type: “VALMAP”.
@displayname string containing the Valmap object’s display name. If the matrix has no display name set, the name is returned.
@name string containing the Valmap object’s name.
@remarks string containing the Valmap object’s remarks (if available).
@type string with the object type: “VALMAP”.
@updatetime string representation of the time and date at which the Valmap was last updated.
Valmap Examples
valmap b
b.append 0 no
b.append 1 yes
declares a valmap B, and adds two map definitions, mapping 0 to “no” and 1 to “yes”.
valmap txtmap
txtmap.append "NM" "New Mexico"
txtmap.append CA California
txtmap.append "RI" "Rhode Island"
declares the valmap TXTMAP and adds three definitions. The valmap values and labels may be enclosed in quotation marks, if necessary.
Append one or more value/label mappings to a valmap's specification.
Syntax
valmap_name.append value1 label1 [value2 label2...]
Examples
valmap b
b.append 0 no
b.append 1 yes
The first line declares a valmap object. The following lines set the specification for that valvalmap: 0s are mapped to “no” and 1s are mapped to “yes”. The valmap values and labels may be enclosed in quotation marks, if necessary.
Cross-references
For details, see
“Value Maps”.
Clear the contents of the history attribute.
Removes the valmap’s history attribute, as shown in the label view of the valmap.
Syntax
valmap_name.clearhist
Examples
v1.clearhist
v1.label
The first line removes the history from the valmap V1, and the second line displays the label view of V1, including the now blank history field.
Cross-references
See
“Labeling Objects” for a discussion of labels and display names.
Clear the contents of the remarks attribute.
Removes the valmap’s remarks attribute, as shown in the label view of the valmap.
Syntax
valmap_name.clearremarks
Examples
v1.clearremarks
v1.label
The first line removes the remarks from the valmap V1, and the second line displays the label view of V1, including the now blank remarks field.
Cross-references
See
“Labeling Objects” for a discussion of labels and display names.
Creates a copy of the valmap.
Creates either a named or unnamed copy of the valmap.
Syntax
valmap_name.copy
valmap_name.copy dest_name
Examples
v1.copy
creates an unnamed copy of the valmap V1.
v1.copy v2
creates V2, a copy of the valmap V1.
Cross-references
Display name for a valmap objects.
Attaches a display name to a valmap which may be used to label output in place of the standard valmap object name.
Syntax
valmap_name.displayname display_name
Display names are case-sensitive, and may contain a variety of characters, such as spaces, that are not allowed in valmap object names.
Examples
hrs.displayname Valmap for Hours Worked
hrs.label
The first line attaches a display name “Valmap for Hours Worked” to the valmap object HRS, and the second line displays the label view of HRS, including its display name.
Cross-references
See
“Labeling Objects” for a discussion of labels and display names.
Display or change the label view of a valmap, including the last modified date and display name (if any).
As a procedure, label changes the fields in the valmap label.
Syntax
valmap_name.label
valmap_name.label(options) [text]
Options
The first version of the command displays the label view of the valmap. The second version may be used to modify the label. Specify one of the following options along with optional text. If there is no text provided, the specified field will be cleared.
c | Clears all text fields in the label. |
d | Sets the description field to text. |
s | Sets the source field to text. |
u | Sets the units field to text. |
r | Appends text to the remarks field as an additional line. |
p | Print the label view. |
Examples
The following lines replace the remarks field of VMAP with “Data from CPS 1988 March File”:
vmap.label(r)
vmap.label(r) Data from CPS 1988 March File
To append additional remarks to VMAP, and then to print the label view:
vmap.label(r) Log of hourly wage
vmap.label(p)
To clear and then set the units field, use:
vmap.label(u) Millions of bushels
Cross-references
See
“Labeling Objects” for a discussion of labels.
Push updates to OLE linked objects in open applications.
Syntax
valmap_name.olepush
Cross-references
See
“Object Linking and Embedding (OLE)” for a discussion of using OLE with EViews.
Set the object attribute.
Syntax
valmap_name.setattr(attr) attr_value
Sets the attribute attr to attr_value. Note that quoting the arguments may be required. Once added to an object, the attribute may be extracted using the @attr data member.
Examples
a.setattr(revised) never
String s = a.@attr("revised")
sets the “revised” attribute in the object A to the string “never”, and extracts the attribute into the string object S.
Cross-references
Definitions view of a valmap object.
Syntax
valmap_name.sheet(options)
Options
p | Print the definitions view. |
Examples
vm1.sheet
displays the definitions view of the valmap object VM1.
Cross-references
See
“Value Maps” for a discussion of value maps.
Statistics for valmap usage.
Displays a description of the composition of a valmap.
Syntax
valmap_name.stats(options)
Options
Examples
map1.stats
displays the summary descriptive view of the definitions in the valmap MAP1.
Cross-references
See
“Value Maps” for a discussion of value maps.
Find series and alphas which use the valmap.
Display list of series and alpha objects which use the valmap.
Syntax
valmap_name.stats(options)
Options
Examples
map1.usage
displays a list of series and alphas which use the valmap MAP1.
Cross-references
For additional details, see
“Value Maps”.
Declare a value map object.
Syntax
valmap valmap_name
Follow the valmap keyword with a name for the object.
Examples
The commands:
valmap mymap
mymap.append 3 three
mymap.append 99 "not in universe"
declare the valmap MYMAP and add two lines mapping the values 3 and 99 to the strings “three” and “not in universe”.
Cross-references
For additional details, see
“Value Maps”.