BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jagadishkatam
Amethyst | Level 16

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
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

4 REPLIES 4
ballardw
Super User

Please show HOW you attempted to specify encoding.

Shmuel
Garnet | Level 18

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';

Tom
Super User Tom
Super User

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.

Jagadishkatam
Amethyst | Level 16
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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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