Specifying the File Type
File Format Specification
Standard Extensions and File-Type Tags
When a COPY command is given, Stat/Transfer tries to determine the file types of both the input and output files by looking for standard extensions.
An alternative for specifying the file type is to use a "file-type tag" instead of a standard extension. In some cases, this tag is needed even when standard extensions are used.
See the table below for a list of the standard extensions and file-type tags used by Stat/Transfer. A list of standard extensions and file-type tags can be obtained by typing:
help formats
at the command prompt.
Standard Extensions
If you use standard file extensions for your input and output file names, these will usually tell the Stat/Transfer command processor what kind of file is to be read or written. Occasionally you will need to add a file-type tag as well.
File-Type Tags
File-type tags are needed in two different situations:
-
For output files when the standard extension for different versions of a file type is the same.
-
For file names that do not have standard extensions.
Distinguishing Versions of an Output File Type
In those cases where different versions of a given file type use the same standard extension, the standard extension will not enable Stat/Transfer to distinguish between different versions on output. To write a version other than the default version, the output file name must be preceded by a file-type tag, which identifies the appropriate output version.
Note: For JMP files, a file type tag may be necessary on input as well.
Whenever the same standard extension appears in the table below for a given file type, you must use a file-type tag. The default version is marked with an asterisk.
File Names without Standard Extensions
If your file does not have a standard extension, you must precede the file name by a file-type tag, which indicates the file type.
For example, if you want to write a Windows SAS file that has a .dat extension instead of an .sas7bdat extension, you can type
copy indata.xls sas outdata.dat
where 'sas' indicates that the output file is to be a SAS Windows file, while the standard extension .xls identifies the input file as an Excel worksheet.
Distinguishing Between File Names and File-type Tags
The command processor uses the presence of a period '.' to differentiate between extensions and file-type tags. Therefore, when using the COPY command, you must either use a period in your file name or, if the name does not contain a period, then you must use one after the file name.
For example, if you have a Stata file named populat, and you are going to a 1-2-3 file, populat.wk3 , the COPY command would look like:
copy stata populat. populate.wk3
The file-type tag must be used since the input file does not have a standard extension. The period after the file name tells Stat/Transfer that this is the file name.
The standard extensions and file-type tags used by the command processor are:
|
File Type |
Extension |
File-Type Tag |
Default |
|
1-2-3 |
wk? |
123 |
|
|
Access |
mdb |
access |
|
|
ASCII - Delimited |
txt, csv |
delim |
|
|
ASCII - Delimited with Schema |
stsd (Schema file) |
stdelim |
|
|
ASCII - Fixed with Schema |
sts (Schema file) |
stfixed |
|
|
BayseiaLab |
csv |
beyes |
|
|
dBASE and compatibles |
dbf |
xbase |
|
|
DDI Schemas |
xml |
ddi |
|
|
Epi Info |
rec |
epi |
|
|
EViews |
wf1 |
eviews |
|
|
Excel 2007+ |
xlsx |
excelx |
|
|
Excel 97+ |
xls |
excel |
** |
|
Excel Version 2 |
xls |
excel2 |
|
|
FoxPro |
dbf |
xbase |
|
|
Gauss '96 |
dat |
gauss |
|
|
GenStat |
gwb |
gwb |
|
|
HTML |
htm* |
html |
|
|
JMP Version * |
jmp |
jmp* |
|
|
Please see the discussion of JMP in the Supported Files Section. |
|
||
|
JSON-Stat |
json |
json |
|
|
LIMDEP |
lpj |
lpj |
|
|
Matlab 7 |
mat |
matlab7 |
** |
|
Matlab |
mat |
matlab |
|
|
Mineset |
schema, sch |
mineset |
|
|
Minitab |
mtw |
minitab |
|
|
Mplus |
inp |
mplus |
|
|
NLOGIT |
lpj |
nlogit |
|
|
ODBC |
[none] |
odbc |
|
|
OpenDocument Spreadsheet |
ods |
od |
|
|
OSIRIS |
dict, dct |
osiris |
|
|
Paradox |
db |
paradox |
|
|
Quattro Pro |
wq?, wb? |
quattro |
|
|
R |
rdata |
r |
|
|
RATS |
rat |
rats |
|
|
SAS V6 (Windows and OS/2) |
sd2 |
sas2 |
|
|
SAS V6 (Mac, Unix-HP, Sun, IBM) |
ssd01 |
sas1 |
|
|
SAS V7and V8 |
sas7bdat |
sas |
|
|
SAS V9 |
sas7bdat |
sas9 |
** |
|
SAS CPORT |
stc |
cport |
|
|
SAS Transport Files |
xpt, tpt |
sasx |
|
|
S-PLUS |
. |
splus |
** |
|
S-PLUS (HP, IBM, Sun Unix) |
. |
splus-hl |
|
|
SPSS Data Files |
sav |
spss |
|
|
SPSS Data Files (HP,IBM,SunUnix) |
sav |
spss-hl |
|
|
SPSS Portable Files |
por |
spssp |
|
|
SPSS "Syntax" and Data File |
sps |
spsss |
|
|
SPSS Program and ASCII data |
sps |
spss-dat |
|
|
Stata |
dta |
stata |
|
|
Stata Program and ASCII Data |
do |
stata-dat |
|
|
Statistica Version 5 and 6 |
sta |
statistica |
** |
|
Statistica Version 7+ |
sta |
statistica7 |
|
|
SYSTAT |
sys |
systat |
|
|
Triple-S |
xml |
sss |
|