If a dataframe has no rows and I convert it to xpt format, I get type numeric for all the columns

I have a dataframe in R, which I am exporting to xpt format using the SASxport:: write.xport function. It exports correctly, but I since no data is present in the dataframe, all the column types are numeric. I want to change some of them to character and change their lengths as well.

In another xpt file which was derived from SAS directly, the types are character and numeric both but their is no data present. So how to change the data type in the xpt file to character if no rows are present in the data frame?

Appreciate any help, Thanks.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.