- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I have several SAS datasets I need to convert to XPT files.
The files are currently SAS7BDAT files. Example: adae.sas7bdat
The files were originally created in Japanese.
I using the following code to create the XPT files but not having success.
proc copy in=insas out=sasxpt;
select adae;
run;
NOTE: Data file INSAS.ADAE.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
NOTE: Data file SASXPT.ADAE.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
ERROR: Unable to transcode character data, such as a name or label, for the file header of SASXPT.ADAE.DATA. Either the data
contains characters that are not representable in the new encoding or truncation occurred during transcoding.
ERROR: File SASXPT.ADAE.DATA has not been saved because copy could not be completed.
NOTE: Statements not processed because of errors noted above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You need to use proc cport or libname XPTLIB xport "&path";
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
libname insas "~...\SAS Data";
filename tranfile "~....\adae.xpt";
proc cport data=insas.adae file=tranfile;
run;
NOTE: Data file INSAS.ADAE.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
NOTE: PROC CPORT begins to transport data set INSAS.ADAE
ERROR: Some character data was lost during transcoding in the dataset INSAS.ADAE. Either the data contains characters that are not
representable in the new encoding or truncation occurred during transcoding.
NOTE: The SAS System stopped processing this step because of errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The message states that the encoding used to create the files should match the SAS session encoding, or the session can't properly recognise some characters.
Run this to see your session encoding:
proc options group=languagecontrol; run;
If you won't or can't change the session encoding, you could try using the INENCODING= and OUTENCODING= libname options to copy these files while respecting their encoding.
I am unsure this would work.
Another pointer: Asian languages might require the CVS libname read engine when being used in a latin encoding session. I am also unsure as I never had to deal with Asian languages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do SAS XPORT format files support UTF8? DBCS?
But your main problem is you need to set your SAS session in a mode that can READ the SAS dataset.
I would start by making sure you are running using Unicode support.
If you can't get that to work try running SAS using DBCS.