BookmarkSubscribeRSS Feed
Petter_Ferro
Calcite | Level 5

Hi,

 

I have a number of SAS programs set up in Task Scheduler to be run automatically each day. One of them is never run through because there are encoding issues. If I run the program manually however it succeeds. In Task Scheduler the encoding is this:

 

proc options option=encoding;

ENCODING=UTF-8 Specifies the default character-set encoding for the SAS session.

 

When I run exactly the same program manually the encoding is instead:

 

proc options option=encoding;

ENCODING=WLATIN1 Specifies the default character-set encoding for the SAS session.

 

Because of this I try to change the encoding for specific datasets in the program like this:

 

proc datasets library=work nodetails nolist;
modify DATASET/ correctencoding='wlatin1';
quit;

 

and like this:

 

data DATASET_1 (encoding="wlatin1");
set DATASET;
run;

 

But I still get this in Task Scheduler:

 

NOTE: Data file DATASET 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: Some character data was lost during transcoding in the dataset DATASET.
Either the data contains characters that are not representable in the new encoding or
truncation occurred during transcoding.

 

In the folder SASFoundation -> 9.4 there is both an "en" folder and an "u8" folder.

 

I don´t want to mess with the configuration files. Is there a way to solve this in my original SAS program?

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

It seems that SAS loads one configuration file when called from the scheduler and another when run manually. Just ensure that both configuration files set the same encoding value for their respective SAS session.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 770 views
  • 0 likes
  • 2 in conversation