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

CONVERT CHARACTER (SET)

Name:
    CONVERT CHARACTER (SET)
Type:
    Subcommand under SET
Purpose:
    Specifies how Dataplot will handle character data.
Description:
    In versions of Dataplot prior to January, 2004, Dataplot did not support reading character variables in data files. The one execption was the READ ROW LABELS command (HELP READ ROW LABELS for details). If encountered, Dataplot would generate an error message and not read the data file correctly. To address this, we have added the command

      SET CONVERT CHARACTER <ON/IGNORE/ERROR>

    These options result in the following actions:

    1. Specifying ERROR continues the current Dataplot action of reporting an error. This is recommended for the case when a file is suppossed to contain only numeric data and the presence of character data is in fact indicative of an error in the data file.

      To maintain compatibility with previous versions of Dataplot, this is the default setting.

    2. Specifying IGNORE instructs Dataplot to simply ignore any fields containing character data. No error or warning messages are printed.

    3. Specifying ON instructs Dataplot to read character. The character fields are written to the file "dpzchf.dat" in the current directory.

      The first line of this file specifies the number of character fields. Lines 2 thru N+1 (with N denoting the number of character fields) identify the names of the character variables. Each of the remaining lines contain the character fields for one row of character data. Each character variable is written as 24 characters (character fields with more than 24 characters are truncated and those with less than 24 characters are right-padded with spaces) followed by one space.

      As with numeric variables, character variable names can be up to eight characters long. Note that Dataplot does not save the character variable names in its internal name table (they are only saved in the "dpchzf.dat" file). Be aware that the "dpchzf.dat" file is overwritten each time a file with character data is encoutered.

    There are some restrictions on when Dataplot will try to read character data:

    1. This only applies to the variable read case. That is, READ PARAMETER and READ MATRIX will ignore character fields or treat them as an error.

    2. Dataplot will only try to read character data from a file. When reading from the keyboard (i.e., when READ is specified with no file name), character data will be ignored when a SET CONVERT CHARACTER ON is specified.

    3. This capability is not supported for the SERIAL READ case.

    4. The SET READ FORMAT command does not accept the "A" format specification for reading character fields.

    Some of these restrictions may be addressed in subsequent releases of Dataplot.

Syntax:
    SET CONVERT CHARACTER <ON/IGNORE/ERROR>
    where <ON> specifies that character data will be read and saved in dpchzf.dat, IGNORE specifies that character data will be ignored, and ERROR specifies that character data will be treated as an error.
Examples:
    SET CONVERT CHARACTER ON
    SET CONVERT CHARACTER IGNORE
    SET CONVERT CHARACTER ERROR
Note:
    In recognizing character data, Dataplot treats certain characters as delimiters:

      spaces (non-printing characters, such as tabs, are treated as spaces)
      commas
      : or ;
      %
      / or \
      ( or)

    If Dataplot encounters one of these characters in a character field, it treats it as the end of the character field (the delimiter will not be part of the string.

    If you have character data that will contain one or more of these delimiters, then the character fields need to be enclosed in quotes (either single or double quotes may be used). If the character fields may contain quotes, then use one type (i.e., single or double) as the delimiter and the other type in the character field. At the current time, Dataplot will not accomodate both types of quotes in the character fields.

Note:
    Dataplot supports a limited number of commands that can utilize the character data saved in "dpchzf.dat". As of the January, 2004 version, this includes

      LET Y = CHARACTER CODE IX
      LET Y = ALPHABETIC CHARACTER CODE IX
      LET IG = GROUP LABELS IX
      LET ROWLABEL = IX

    The TIC MARK LABEL FORMAT and TIC MARK LABEL CONTENT commands have been updated to use group labels for the tic mark labels.

    For details, enter

      HELP CHARACTER CODE
      HELP ALPHABETIC CHARACTER CODE
      HELP GROUP LABELS
      HELP ROWLABEL
      HELP TIC MARK LABEL FORMAT
      HELP TIC MARK LABEL CONTENT

    We anticipate additional use will be made of character data in subsequent versions of Dataplot.

Default:
    ERROR (character data will be treated as an error)
Synonyms:
    None
Related Commands:
    READ = Carries out a column-wise input of data.
    CHARACTER CODE = Converts character data to a coded numeric variable.
    ALPHABETIC CHARACTER CODE = Converts character data to a coded numeric variable.
    GROUP LABELS = Define group labels from character data.
    ROWLABELS = Define row labels from character data.
Applications:
    Input/Output
Implementation Date:
    2004/1
Program:
     
        set convert character on
        skip 25
        read draft69c.dat rank day month
        .
        let ig = group label month
        x1tic mark label format group label
        x1tic mark label content ig
        x1tic mark font simplex
        x1tic mark angle 45
        let xcode = character code month
        .
        major xtic mark number 12
        minor xtic mark number 0
        xlimits 1 12
        xtic offset 0.5 0.5
        .
        char box plot
        line box plot
        fences on
        .
        box plot y xcode
        
    plot generated by sample program

Privacy Policy/Security Notice
Disclaimer | FOIA

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

Date created: 2/3/2004
Last updated: 10/13/2015

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