Learning SAS? Welcome to the exclusive online community for all SAS learners.

Error Importing .CPT File

Reply
New Contributor
Posts: 4

Error Importing .CPT File

Sorry if this is a more basic problem. I still haven't figured it out after weeks of using the online forums and past questions, so I thought I might try to ask here.


I have a ".CPT" file from work and I am simply trying to open it by importing into SAS. At first it gave me the following error:

ERROR: The transport file was created in the encoding wlatin1.  This session encoding, utf-8, can read and create transport files

         in the encoding, utf-8.  Data not imported.


So I added this phrase: encoding = ‘wlatin1’ to my code. My final code looks like this:


Libname newlib '/folders/myfolders/myData';     /*  where you want the new data to go */
Filename tranfile '/folders/myfolders/COMPANY_DATA/THIS_FILE.CPT' encoding='wlatin1';  /* Where the transport file is stored now */


  proc cimport library=newlib infile=tranfile;
run;


options fmtsearch = (newlib);  /* this will enable SAS to find the formats in the catalog*/


However now I have the error:

ERROR: Given transport file is bad.


I really do not know what to do to fix this. The forums I have read talk about unicodes or locales or other languages/encodings. The data I have from work is from the United States, I do not think there is a language problem, although the file is from another company and I do not have much information on it.

Any information would be appreciated!!


Thank you!

Lexie

SAS Super FREQ
Posts: 361

Re: Error Importing .CPT File

Hi, Leslie! We have had a rash of folks trying to import this particular transport file into University Edition!

UE uses UTF-8 for its session, and you cannot change that to be latin1. It is something set at startup time, and not something you can change.

Since UE is a learning tool, it isn't generally an issue but would come into play in this case. If you have access to SAS Foundation through school or work, you can change the session encoding with it.

Regards,

Randy

Ask a Question
Discussion stats
  • 1 reply
  • 432 views
  • 3 likes
  • 2 in conversation