WWW | Store | Account | Contact Us
SHAZAM Homepage

READ

The READ command inputs SHAZAM data and assigns variable names. When data is not in a separate file the data directly follows the READ command. However, if the data is in a separate file the READ command must specify the file containing the data with either a filename or unit number. If a unit number is used there must be a previous FILE command which assigns the file to the unit number. This command is for working with Fixed Format or Free Format numeric or character data or for working with Data Interchange Format (DIF) files.

In general, the formats of the READ command are:

READ vars / options

READ (unit) vars / options

READ (filename) vars / options

The available options are:

OPTION DESCRIPTION
beg= Sets a sample BEGinning which overrides the sample size set on the latest SAMPLE command. The sample size set by this option will only be used for the current command. Subsequent problems will be performed according to the sample range set by the latest SAMPLE command.
binary Used when the data is in Double Precision BINARY (unformatted). If the FILE command is used to assign the BINARY file, follow the instructions above to include a '.' after the unit number on the FILE command.
byvar Used when the data is to be read variable BY VARiable rather than observation by observation. When this option is used, the data for each new variable must begin on a new line. If this option is not used, the data for each new observation must begin on a new line. Observations deleted by the SKIPIF command or the expanded form of the SAMPLE command are included when this option is used.
charvars= Specifies the number of character variables. This option allows the input of character variables without using the FORMAT option. The character variables must be the leading variables in the data set. The data is read by recognizing blanks or commas as delimiters. If the character variable contains embedded blanks then the variable must be enclosed by quotes.
close Closes a file that was opened for a READ command. If this option is used, the file will no longer be assigned to the unit number as specified with the FILE command.
cols= Specifies the number of COLumnS when a matrix is being read in. Only one matrix can be read in on a given READ command and if a matrix is being read in, no other variables may be read in on that READ command. SKIPIF commands are not in effect when a matrix is read. The beginning observation on the SAMPLE command is used as the first row number for the matrix. Use the option BEG=1 to ensure that the matrix begins at row 1.
dif Reads data from a DIF file. DIF files can be created by spreadsheet programs. Refer to the section on USING DIF FILES in the SHAZAM Reference Manual. This option is automatically in effect for filenames with the .DIF extension.
end= Sets a sample ENDing which overrides the sample size set on the latest SAMPLE command. The sample size set by this option will only be used for the current command. Subsequent problems will be performed according to the sample range set by the latest SAMPLE command.
eof Forces SHAZAM to read to the End Of the data File regardless of the SAMPLE command in effect. This is the default if no SAMPLE command has been previously specified.
format Data will be read in according to the FORMAT previously specified on the FORMAT command. The format will be stored in a SHAZAM variable called FORMAT. Details on the FORMAT command are given in the SHAZAM Reference Manual.
list LISTs all data read. This option is equivalent to a READ command together with a PRINT command.
names Specifies that the variable names are included as the first line in the data set. When this option is used the list of variable names is not required on the READ command. The first line of the data set cannot exceed 130 columns. A line terminated with ampersand indicates that the next line is a continuation line.
nobyvar Used when the data is to be read observation by Observation rather than variable BY VARiable. Observations deleted by the SKIPIF command or the expanded form of the SAMPLE command are included when this option is used. This option is the default.
norewind By default the READ command loads the data set starting at the first record of the data file. If multiple READ commands are used to load data sequentially from a data file, then the NOREWIND option must be specified.
rewind Rewinds the input data file before reading any data. This is the default.
rows= Specifies the number of ROWS when a matrix is being read in. Only one matrix can be read in on a given READ command and if a matrix is being read in, no other variables may be read in on that READ command. SKIPIF commands are not in effect when a matrix is read. The beginning observation on the SAMPLE command is used as the first row number for the matrix. Use the option BEG=1 to ensure that the matrix begins at row 1.
skiplines= SKIPs the number of LINES specified before reading in any data. It is used if a data file contains a certain number of lines such as labels or comments which need to be skipped before reading in the data.
wide WIDE uses 120 columns and NOWIDE uses 80 columns. The default setting is described in the SHAZAM Reference Manual chapter SET AND DISPLAY.