Read and Write 'SAS' 'XPORT' Files

Functions for reading, listing the contents of, and writing 'SAS' 'xport' format files. The functions support reading and writing of either individual data frames or sets of data frames. Further, a mechanism has been provided for customizing how variables of different data types are stored.


News

Bug fixes:

  • Now works properly on big-endian systems such as the PowerPC, Spark. (Reported by Brian Ripley )x

  • Explicitly cast left bit shifts to avoid undefined C language behavior. (Reported by Brian Ripley)

  • Resolve problem in accessing "Hmisc::label.default<-" if SASxport::read.xport is called without loading SASxport. (Reported by Dominic Comtois)

  • 'read.xport' now preserves '$' at the beginning of SAS character format and iformat strings. (Reported by Dominic Comtois)

  • 'read.xport' argument names.tolower was not being honored for dataset names. (Reported by Dominic Comtois)

Other changes:

  • Modified several test files to display generated .xpt data so that issues can be more easily detected and diagnosed.

  • C code cleanup and reorgaization to improve clarity.

API Change:

  • SASxport now relies on the 'label' methods defined by the Hmisc package instead of defining its own.

Bug fixes:

  • The 'read.xport' and 'write.xport' functions were failing when both the SASxport and the Hmisc packages were loaded due to conflicts between the label methods defined by each package. This has been resolved by removing the label methods from SASxport and using those from Hmisc instead.

Bug fixes:

  • In manual pages for read.xport() and lookup.xporT(): Update URL for 'test2.xpt', and use a local copy for executed example code.

Bug fixes:

  • read.xport() and write.xport() now properly handle empty dataset/dataframe objects.

Bug fixes:

  • Correct error in write.xport when a factor contains only NA entries.

Other Changes:

  • Package test scripts now use a fixed timezone to prevent unhelpful warnings.

New features:

  • dataset label and type are now supported. See write.xport() and read.xport() for examples.

Bug fixes:

  • Integrate patch from foreign package to properly handle xport files with datasets that end exactly on an 80-byte record boundry & add corresponding test file.

  • Replace file.path(path.package(...)) with system.file(...)

Changes:

  • Remove oboslete .First.lib() function

  • Replace file.path(path.package(...)) with system.file(...)

Changes:

  • Replace use of depreciated .path.package() with path.package() for R 3.0.0.

New features:

  • New function makeSASNames() to create valid and unique SAS names from character vectors.

Bug fixes:

  • Improper handling of duplicates names in write.xport() was generating names longer than 8 characters, resulting in invalid files. Corrected by using the new makeSASNames() function instead of the R make.names() function.

Bug fixes:

  • Fix bug in handling of 'as.is' argument to read.xport ('as.is=TRUE' was not operating as documented).

Bug fixes:

  • Fix typo in manual page for write.xport() reported by Yinlai Meng.

Bug fixes:

  • Apply patches to fix problems on 64 bit platforms, as sumitted by Brian Ripley.

Other:

  • Correct warning message due to extraneous ';' charcters after function closing braces.

New Features:

  • SAS format and iformat information is now accessed via 'SASformat()' and 'SASiformat()' functions instead of 'formats' and 'iformat'. The information accessed by these functions is now stored in attributes with the same name. This avoids conflicts with the use of 'format' by chron objects.

  • Copies of the code for foreign::read.xport and foreign::lookup.xport is now part of the SASxport package, permitting extension to these functions as needed, and removing the dependency on the foreign package.

  • Overflow of SASxport numeric format values, which have a smaller range than IEEE 754 numeric values now standard, now generates NAN instead of 0.0.

Bug Fixes:

  • Fix for problem storing negative numbers.

  • SAS format length and digit information is now properly captured by read.xport(). This is supported by an improved version of lookup.xport().

  • SAS format information was not being properly utilized when more than one format was present.

  • Improved handling of SAS date formats

Other:

  • Test routines added to test handling of numeric values.
  • Display support information at package startup

New Features:

  • Add support for autogeneration of SAS FORMAT information as a PROC CONTENTS fmtin= dataset. This enables R factors to be handled properly on the receiving system.

Bug Fixes:

Other:

New Fetures:

Bug Fixes:

Other:

New features:

  • read.xport's names.tolower argument now defaults to FALSE so that variable (and data set) names are now left as uppercase.

  • Improved crediting of BRL-CAD source code

Bug fixes:

  • Correct call to sprintf where printf was intended in src/ieee2ibm.c

Other:

  • Augmented ieee2ibm code with corresponding ibm2ieee code for completeness.

New Features:

  • Replaced IEEE to IBM translation code with GPL'ed version from BPL-CAD.

Bug Fixes:

  • Changes to C code should correct the C99 usage errors

  • Correct documentation typos, including those reported by Tim.

Initial version of the SASxport package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("SASxport")

1.5.3 by Gabor Csardi, 2 years ago


https://github.com/mangothecat/SASxport


Report a bug at https://github.com/mangothecat/SASxport/issues


Browse source code at https://github.com/cran/SASxport


Authors: Unless otherwise noted, the contents of this package were written by Gregory R. Warnes <greg@warnes.net> and are provided under the terms of the GNU General Public License, version 2.0 or later. -- The files 'src/ieee2ibm.c' and 'src/ibm2ieee.c' were extracted from BRL-CAD file /brlcad/src/libbu/htond.c written by Michael John Muuss, Copyright (c) 2004-2007 United States Government as represented by the U.S. Army Research Laboratory, and is utilized and redistributed under the terms of the GNU Lesser General Public License, version 2.1. -- The files 'R/AFirst.lib.s', 'R/all.is.numeric.R', 'R/importConvertDateTime.R', 'R/in.opererator.R', 'R/makeNames.R', 'R/read.xport.R', and 'R/testDateTime.R' are copied or adapted from the 'Hmisc' package created by Frank E. Harrell, Jr. <f.harrell@vanderbilt.edu>, and are utilized and redistributed under the terms of the GNU General Public License, version 2.0 or later. -- The files 'R/xport.R', 'src/SASxport.c', 'src/SASxport.h', and 'src/foreign.h' are copied or adapted from the 'R' 'foreign' package created by Douglas M. Bates <bates@stat.wisc.edu> and Saikat DebRoy <saikat@stat.wisc.edu>, and are utilized and redistributed under the terms of the GNU General Public License, version 2.0 or later. -- The creation of this package was partially funded by Metrum Institute <http://metruminstitute.org>.


Documentation:   PDF Manual  


GPL-2 license


Imports chron, Hmisc, utils


Imported by BEACH, define.

Suggested by datetime.


See at CRAN