Purpose
Indicates that the data are to be read and, for text file input, specifies the name of the input file. This command is used for both text files and BSF files.
Syntax
INPUT { fname | < } { SAVE { nlist } { ; AS fname } } @
INPUT + @
Arguments and Subcommands
fname
The input data file. This argument is required if the data are being read from a text file. If the input file is a text file, the NAMES command must precede the INPUT command. If the data are being read from a BSF file, the input file name has already been indicated with the USE command, and fname is ignored.
<
This is used when the data are in the same file as the commands needed to read the data. The data records follow the INPUT command. If you use the DATA command with the ` subcommand to write the data to a file, the first few lines will contain the EPICURE commands needed to read the data and the rest of the file will consist of the data records.
SAVE {nlist}
Indicates the data are to be written directly to a BSF file following any edit transformations. In this case, the data are not retained in RAM. The SAVE command is useful in preparing a large data set for use in the creation of a DATAB table. The nlist is optional and if omitted, all variables in the input data including those created by edit transformations will be written to the BSF file.
; AS fname
This option specifies the name of the BSF file to be created. If fname has no extension and does not end with a period (.),.BSF is assumed. If fname is omitted, the file will be saved with the same name as the input file with the extension BSF. Thus, fname can be omitted if the data are being read from a text file, but is required when the input are from a BSF file. When DATAB is being used to create a table, the SAVE subcommand is ignored.
+
This option is used to create data sets without the need to read data from an existing file. Using this option, it is easy to generate data sets for use in simulations.
The number of records to be generated must be specified with the RECORDS command using this option. Transformations can be used to create new variables. Transformations can be entered either before or after the INPUT command (see Example e)). This feature is illustrated in the LOOPTEST.PNT example.
Remarks
The SAVE option allows the user to create BSF files from data sets which are larger than the available workspace. BSF files created in this way can, for example, be used to create event-count or event-time tables in DATAB. If a data set fits into the available workspace, it is more efficient to read the data using the INPUT command without a SAVE subcommand and use a separate SAVE command to create a BSF file.
When the SAVE option is used with the INPUT command, the data are read and a BSF file is created but the data are not retained in memory. This means that the data are not available for use in transformations or analyses after having been read.
BSF files are only partially compatible across platforms. EPIWIN can read but not write BSF files created by earlier versions of EPICURE.
Examples
a) Read the data from a text file called DOLLHILL.DAT:
NAMES age time smkamnt lungca
pyr @
INPUT dollhill.dat
b) If data are being read from a BSF file, the input file name has already been indicated with the USE command so one need only enter INPUT @ in order to read the data file. To read data from a BSF file called DOLLHILL.BSF:
USE dollhill
INPUT @
c) To read data from a BSF file as in b), but edit the data as they are read:
USE dollhill
TRAN sex = sex
- 1;
IF (city == 1) THEN DELETE ENDIF
@
INPUT @
d) To read the data when the data are in the same file as the commands
NAMES dcat cases pyr dose @
TRAN dose=dose/100
INPUT < @
1 6 2500 0
2 4 1000 10
3 8 1000 20
4 4 350 25
e) In this example, a data set with 1000 records is created. Transformations are used to generate random failure and censoring times, a cases indicator, and two covariates, one binary and the other continuous.
RECORDS 1000 @TRAN gender = GL(1,2) - 1;
ftime = -5*LOG(1 - RANU(0));
ctime = (-10*LOG(1 - RANU(0)))**0.5;
cases = ftime < ctime;
time = MIN(ftime,ctime);
z = 5 + 1.5*rann(0);
@
INPUT+@