Comments (5)
Thanks for the feedback! This is an issue with our dataset label validation code, and the documentation could be clearer - the dataset label for XPT files is a maximum of 40 bytes rather than characters. Our validation code is currently checking with the default type = "chars"
and should be updated to type = "bytes"
.
@ynsec37 note that the XPT documentation shared above is referring to the variable label length. Although variable labels can be longer in version 8 the maximum dataset label length is still 40 bytes.
from haven.
Hi @botsp It seems that write_xpt()
may only support the xpt creation.
write_sas()
creates sas7bdat files. Unfortunately the SAS file format is complex and undocumented, so write_sas() is unreliable and in most cases SAS will not read files that it produces.
write_xpt()
writes files in the open SAS transport format, which has limitations but will be reliably read by SAS.
For sas7bdat
, I use the same way you mentioned, that is creating the xpt first by R then coverting to sas7bdat by SAS.
After converting, I compared results from write_xpt()
with SAS datasets directly created by SAS, there is no difference except the variable length.
from haven.
Dear developer,
I found that the label length that must be <= 40 is just used for the xpt 5, if the version = 8
the label should be up to 256.
from haven.
Hi both, May I confirm a question about data conversion.
I am trying to convert the *.rda file to *.sas7bdat, and it seems the "write_xpt" doesn't work as expected. The created sas7bdat file cannot be opened, it always shows "file ... is not a SAS data set".
- write_xpt(my_dataset, "P:/Kevin/CDISC_DataFromR/Pharmaverse/Adam/my_sasdsy.sas7bdat") *
I saw some discussion about this issue and doesn't found a good solution.
-
What is the recommended method for converting the *.rda file to a *.sas7bdat file?
-
It seems that "write_xpt" works well when converting to an *.xpt file. Should I first convert the file to an xpt format and then change it to a *.sas7bdat file using SAS? Are there any potential risks associated with this approach?
Looking forward to leanring the insights from your valuable experience. Many thanks!
from haven.
Thanks for your explanation and this inspire me about the method of sas data conversion. Thank you!
from haven.
Related Issues (20)
- Cannot open a SAS7BDAT generated/edited from JMP
- Use strings for versions
- Release haven 2.5.3
- bug while reading sas7bdat file HOT 4
- Vulnerability in SAS7BCAT reader HOT 2
- Progress Bar for XPT HOT 1
- Returning full variable labels HOT 1
- New feature proposal: Reads creation/modified time of SAS7BDAT HOT 3
- Unable to allocate memory when opening a dta file HOT 1
- Upkeep for haven (2023)
- Use standard argument checkers
- `write_dta()` can error if labelled values are large enough
- Zero-length label worse than null label
- Remind the novice user of labelled-format? HOT 2
- Dates in labelled_spss HOT 3
- Release haven 2.5.4
- Allow `labels` to be passed through to `labelled()` as unnamed vector of same length as `x`
- `read_xpt()` fails on misconstructed dates HOT 3
- typo in docs for as_factor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haven.