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.

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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