SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

CHARACTER VARIABLE (SET)

Name:
    CHARACTER VARIABLE (SET)
Type:
    Subcommand under SET
Purpose:
    Specify whether the READ command and the LET ... = STRING VARIABLE command will overwrite the contents of the "dpzchf.dat" file or append new character variables to the current contents of "dpzchf.dat".
Description:
    Dataplot primarily works with numeric data. However, there is limited support for character variables. Note that since character variables have limited use in Dataplot, they are not saved in memory as are numeric variables. Instead, they are written to the file "dpzchf.dat".

    Dataplot has two commands for creating character variables. If the SET CONVERT CHARACTER command is set to ON or CATEGORICAL, then the READ command will parse character variables and save them to the file "dpzchf.dat". The LET ... = STRING VARIABLE command can create a character variable from a list of pre-defined strings (or literal text enclosed in quotes). This command will also save the character variable to "dpzchf.dat".

    By default, either of these commands will overwrite the current contents of "dpzchf.dat". However, you can request that the new character variables be appended to the current contents of "dpzchf.dat" instead.

    Typically, the append option is most likely to be used with the LET ... = STRING VARIABLE command.

Syntax:
    SET CHARACTER VARIABLE <OVERWRITE/APPEND>
    where OVERWRITE specifies that the current contents of "dpzchf.dat" will be overwritten and APPEND specifies that the new character variables will be appended to the current contetns of "dpzchf.dat".
Examples:
    SET CHARACTER VARIABLE OVERWRITE
    SET CHARACTER VARIABLE APPEND
Note:
    The "dpzchf.dat" file is simply an ASCII file. Its contents look something like (this is the file created in the Program example below)
        
      3 IX 3 IY 3 IW 4 Row_1 xxxxx aaaa Row_2 yyyyy bbbb Row_3 zzzzz cccc dddd
    The first row specifies the number of character variables in the file. The next several rows identify the variable name and the number of rows for that character variable. The remaining rows contain the contents for the character variables. Character variables currently have a maximum length of 24 characters.
Default:
    OVERWRITE
Synonyms:
    None
Related Commands:
    READ = Carries out a column-wise input of data.
    STRING VARIABLE = Create a character variable from a list of previously defined strings.
Applications:
    Input/Output
Implementation Date:
    2020/01
Program:
     
    rm dpzchf.dat
    set convert character on
    read ix iy
    Row_1   xxxxx
    Row_2   yyyyy
    Row_3   zzzzz
    end of data
    list dpzchf.dat
    pause
        
    The following output is generated
     
           2
    IX               3
    IY               3
    Row_1                    xxxxx
    Row_2                    yyyyy
    Row_3                    zzzzz
        
     
    .
    set character variable append
    read iw
    aaaa
    bbbb
    cccc
    dddd
    end of data
    list dpzchf.dat
        
    The following output is generated
     
           3
    IX               3
    IY               3
    IW               4
    Row_1                    xxxxx                    aaaa
    Row_2                    yyyyy                    bbbb
    Row_3                    zzzzz                    cccc
                                                      dddd
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 01/22/2020
Last updated: 01/22/2020

Please email comments on this WWW page to alan.heckert@nist.gov.