![]() |
PING
0.9
Statistical data handling and processing in production environment
|
Export (convert) a dataset to any format accepted by PROC EXPORT.
ds : a dataset (e.g., a SAS file);fmt : (option) format for export; it can be any format (e.g., csv) accepted by the PROC EXPORT; default: fmt=csv;dbms : (option) value of DBMS key when different from fmt; default: indeed, when dbms is not passed, it is set to dbms=&fmt;delim : (option) delimiter; can be any argument accepted by the DELIMITER key in PROC EXPORT; default: none is usedilib : (option) input library where the dataset is stored; by default, WORK is selected as input library.ofn : (option) basename of the output exported file; by default (when not passed), it is set to ds;odir : (option) output directory/library to store the converted dataset; by default, it is set to:sysget(SAS_EXECFILEPATH) if you are running on a Windows server,ilib (i.e., sysfunc(pathname(&ilib))) otherwise;_ofn_ : name (string) of the macro variable storing the complete pathname of the output file: it will look like a name built as: &odir./&ofn..&fmt.Run macro %_example_ds_export for examples.
fmt is the same as the type of the input dataset, or if the output dataset already exists, a new dataset will be produced anyway. Please consider using the setting G_PING_DEBUG=1 for checking beforehand actually exporting.G_PING_DEBUG=1), the export operation is aborted; still it can be checked that the output file will be correctly created, i.e. with the correct name and location using the option _ofn_. Consider using this option for checking before actually exporting.fmt=dta (Stata native format), the parameter dbms is set to PCFS. See example 3: _"Export a SAS dataset on UNIX to a Stata file on Microsoft Windows"_ of this webpage; also check this webpage.