Stata 12 License File

Make sure that you have your License and Authorization Key before doing this. Two tricks: 'If you are using Stata 12 and want to save a file so. Stata is a general-purpose statistical software package created in 1985 by StataCorp. Most of its users work in research, especially in the fields of economics, sociology, political science, biomedicine, and epidemiology. Stata's capabilities include data management, statistical analysis, graphics, simulations, regression, and custom programming.

Previous PageNext Page
File Format-Specific Reference for the IMPORT and EXPORT Procedures
DTA Files Essentials

All versions of Stata under Microsoft Windows are supported. Stata fileshave a .dta file extension.

See Example 1: EXPORT a SAS Data Set to a Stata File on a Local System.

DTA Data Types
FILES

Import of all Stata versions under Microsoft Windowsand UNIX is supported. Export of Stata version 8 and later is supported.

MISSING VALUES

Stata supports missing values. SAS missing valuesare written as Stata missing values.

VARIABLE NAMES

When using importing, Stata variable names can beup to 32 characters in length. The first character in a variable name canbe any lowercase letter (a-z) or uppercase letter (A-Z), or anunderscore ( _ ). Subsequent characters can be any of these characters, plusnumerals (0-9). No other characters are permitted. Stata reserves these19 words, which are not allowed to stand alone as variable names:

_all long_N
in_skip_weight
_pred_consfloat
_b_npi
intusingwith
_rcdoubleif
_coef

If the program encounters any of these reservedwords as variable names,it appends an underscore to the variable name to distinguish it from the reservedword. For example, _N becomes _N_.

When exporting, variable names greater than 32 characters are truncated.The first character in a variable name can be any lowercase letter (a-z)or uppercase letter (A-Z), or an underscore ( _ ).Subsequent characters can be any of these characters, plus numerals (0-9).No other characters are permitted. Invalid characters are converted to underscores (_ ).

VARIABLE LABELS

Stata supports variable labels when using the IMPORTprocedure. When exporting, if the variable name is not a valid Stata nameand there is no label, the EXPORT procedure writes the variable name as thelabel.

VALUE LABELS

Stata stores value labels within the data file. Thevalue labels are converted to format library entries as they are read withthe IMPORT procedure. The name of the format includes its associated variablename modified to meet the requirements of format names. The name of the formatis also associated with a variable in the SAS data set. You can use FMTLIB=libref.format-catalog:statement to save the formats catalog under a specified SAS library.

When writing SAS data to a Stata file, the EXPORT procedure saves thevalue labels that are associated with the variables. The procedure uses theformats that are associated with the variables to retrieve the value entries.You can use the FMTLIB=libref.format-catalog statement to tell SAS where tolocate the formats catalog.

Numeric formats only.
DATA TYPES

Stata supports numeric field types that map directlyto SAS numeric fields.

Stata date variables become numerics with a date format.

When writing SAS data to a Stata file, the EXPORT procedure convertsdata into variable type double. A SAS date format becomes a Stata date variable.

Importing and Exporting Data in Stata Files
PC Files Server (DBMS=PCFS)

This IMPORT EXPORT method uses the client/servermodel to access data in Stata files on Microsoft Windows from Linux, UNIX,or Microsoft Windows 64-bit operating environments. This method requires runningthe PC Files Server on Microsoft Windows.

A filename with a .dta extensionis required.
IMPORT and EXPORT Procedures Supported Syntax
FMTLIB=libref.format-catalog

When importing a Stata file, SAS saves value labels to thespecified SAS format catalog. When exporting a SAS data set to a Stata file,SAS uses formats that are associated with the variables to retrieve the valueentries.


Example 1: EXPORT a SAS Data Set to a Stata File on a Local System

This example exports the SASdata set SDF.CUSTOMER, to the Stata file,CUSTOMER.DTA, on a local system.

Sony dcr hc48 driver for mac


Example 2: IMPORT a SAS Data Set from a Stata File on a Local System

This example imports the SAS data set, WORK.CUSTOMER, from the Statafile, CUSTOMER.DTA, on a local system.


Example 3: EXPORT a SAS Data Set on UNIX to a Stata File on Microsoft Windows

This example exports a SAS dataset named SDF.CUSTOMER to a Stata filenamed CUSTOMER.DTA. Note that SAS is running on the UNIX operating platform.The Stata file is loaded on Microsoft Windows where PC Files Server is running.


Ordering stata

Example 4: IMPORT Data from a Stata File on Microsoft Windows to a SAS Data Set on UNIX

This example imports data from a Stata file named CUSTOMER.DTA toaSAS data set named WORK.CUSTOMER. Note that SAS is running on a UNIX platform.The Stata file is located on Microsoft Windows where PC Files Server is running.

Previous PageNext PageTop of Page