Help using Base SAS procedures

issue while importing the transport file (.cpt file) by PROC CIMPORT

Accepted Solution Solved
Reply
Super User
Posts: 1,063
Accepted Solution

issue while importing the transport file (.cpt file) by PROC CIMPORT

[ Edited ]

Dear SAS experts,

 

This is with regard to the issue while importing the transport file (.cpt file) by PROC CIMPORT.

 

The Transport file was created in a Windows environment via PROC CPORT and it has the encoding WLATIN1, but I am trying to Import it in UNIX Environment (default encoding=”UTF-8”) using PROC CIMPORT and it is showing the error as in below screenshot.

 

Capture.PNG

 

libname x '~path';
filename y '~pathx';

proc cimport library=x infile=y;
run;
quit;

 

I tried inencoding as well encoding option as well but it did not solve the issue.could you please suggest how i could overcome this error and read the transport file.

 

I am working on sas 9.4

 

 

 

Thanks,
Jag

Accepted Solutions
Solution
‎11-10-2016 09:35 AM
Super User
Super User
Posts: 6,123

Re: issue while importing the transport file (.cpt file) by PROC CIMPORT

Unfortunately you need to start SAS using the wlatin1 encoding instead of the utf-8 encoding to make the PROC CIMPORT code run.

You cannot change the session encoding setting once the session has started.

 

How to do that depends on how you are starting SAS.  If you are running it on PC then perhaps you already have the choice to launch SAS using different encodings in the START menu.  On my PC there is a "SAS 9.4 (English)" icon and a "SAS 9.4 (Unicode)" icon in the start menu that will let me start with the those two different encodings.  Otherwise on Windows or Unix you can start SAS using a different configuration file or command line options to change the system encoding.

 

If you are using Enterprise Guide, or SAS/Studio or some other method that connects to a server to run SAS then you need to have a way to connect to different services that are configured to use the encoding you need.

 

Check with your local SAS support team, or contact SAS support.

View solution in original post


All Replies
Grand Advisor
Posts: 10,026

Re: issue while importing the transport file (.cpt file) by PROC CIMPORT

Please show HOW you attempted to specify encoding.

Super User
Posts: 1,159

Re: issue while importing the transport file (.cpt file) by PROC CIMPORT

To CPORT you probably have a program like:

     filename cpt  '... path and name.cpt';

     proc cport data=...    file=cpt; run;

 

You just need to define the encoding on filename statement:

     filename cpt  '... path and name.cpt'  encoding='UTF-8';

Solution
‎11-10-2016 09:35 AM
Super User
Super User
Posts: 6,123

Re: issue while importing the transport file (.cpt file) by PROC CIMPORT

Unfortunately you need to start SAS using the wlatin1 encoding instead of the utf-8 encoding to make the PROC CIMPORT code run.

You cannot change the session encoding setting once the session has started.

 

How to do that depends on how you are starting SAS.  If you are running it on PC then perhaps you already have the choice to launch SAS using different encodings in the START menu.  On my PC there is a "SAS 9.4 (English)" icon and a "SAS 9.4 (Unicode)" icon in the start menu that will let me start with the those two different encodings.  Otherwise on Windows or Unix you can start SAS using a different configuration file or command line options to change the system encoding.

 

If you are using Enterprise Guide, or SAS/Studio or some other method that connects to a server to run SAS then you need to have a way to connect to different services that are configured to use the encoding you need.

 

Check with your local SAS support team, or contact SAS support.

Super User
Posts: 1,063

Re: issue while importing the transport file (.cpt file) by PROC CIMPORT

Thank you Tom

I started the sas session like below

sas94 -encoding wlatin1

and then in that sas session I executed the proc cimport and it resolved the issue.
Thanks,
Jag
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 360 views
  • 0 likes
  • 4 in conversation