BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
A-junamu_-
Fluorite | Level 6

I keep running into this error every time I run the outpath and can't figure out the problem. I tried removing and adding the space but it's not working. 

The message "the data file " " is in a format that is native to another host, or the file encoding does not match the session encoding" keeps prompting. 

 

What is the issue?

 

Outpath code: 

LIBNAME PG1 "S:/WORKSHOP/EPG1V2/DATA";

 

%let outpath = "S:/WORKSHOP/EPG1V2/OUTPUT";

 

 

OUTPATH CODES.JPG

outpath error.JPG

outpath no error.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@A-junamu_-  May-be next time ask one question at a time.

So for your 2nd question it's exactly as the SAS log tells you:

The session encoding under which you run your SAS session is not the same like the encoding that has been used when creating your source table.

You see such messages for example when you copy a SAS table created under Windows SAS to an environment under Unix SAS. It's just a Note informing you so nothing bad will happen. Such CEDA reading (Cross Environment Data Access) will impact on performance - but that's it.

View solution in original post

16 REPLIES 16
SASKiwi
PROC Star

Change your OUTPATH macro variable value to not include quotes, as there are quotes already where it is being used:

%let outpath = S:/WORKSHOP/EPG1V2/OUTPUT;

 

A-junamu_-
Fluorite | Level 6
Yes, I just realized this a minute ago. Thanks!
A-junamu_-
Fluorite | Level 6

But what about the encoding issue? I see this in almost all of my logs. 

SASKiwi
PROC Star

Please post your SAS session encoding by running this:

proc options option = encoding;
run;

SAS is simply reporting that the encoding on your SAS dataset does not match the session encoding. Where did the data come from?

A-junamu_-
Fluorite | Level 6
From the sas essentials training program
SASKiwi
PROC Star

Run this to compare session and dataset encoding and post the results:

proc options option = encoding;
run;

proc contents data = pg1.storm_final;
run;
Tom
Super User Tom
Super User

@A-junamu_- wrote:

But what about the encoding issue? I see this in almost all of my logs. 

Tom_0-1654664306116.png

 


That is just an informational message that means exactly what it says.  That the dataset was created with a different version of SAS or perhaps even the same version but with different settings such as the character encodings.  It can convert it but the job might run a little slower because it has to do more work than if you were reading a dataset you created with the same version of SAS.

 

If you have some datasets you are using a lot then copy them over using your current version of SAS and then use the copies instead. 

libname PG1 'path where the foreign datasets live';
libname LOCAL 'some other path where you want the copies to live';
proc copy inlib=pg1 outlib=local noclone;
run;
A-junamu_-
Fluorite | Level 6

I did that, still seeing that message. 

 

Ajunamu__0-1654732148636.png

Ajunamu__1-1654732261573.png

 

SASKiwi
PROC Star

Yes, but only for the PG1 source library version not for the copied LOCAL library version which has had its encoding changed.

A-junamu_-
Fluorite | Level 6

Here's the result. What exactly are you stating "Yes, but only for the PG1 source library version not for the copied LOCAL library version which has had its encoding changed." ?

 

 

Ajunamu__2-1655045543988.png

 

Ajunamu__0-1655045497572.png

 

Tom
Super User Tom
Super User

So to SAS it looks like you are trying reference some type of literal that uses S after the quoted string.

Like TIME literals use a T and DATE literals use a D.

 

That is because you ran this code:

file = ""S:....

So you have an empty string followed by the letter S.

 

Why did you include quotes in the macro variable and then add more quotes in the SAS code? 

Either leave the quotes out of the macro variable

%let outpath = S:/WORKSHOP/EPG1V2/OUTPUT ; 

or make sure to double them up when adding more quotes around the outside.  For example by calling the QUOTE() function.

file = %sysfunc(quote(&outpath/pressure.pdf)) 

 

A-junamu_-
Fluorite | Level 6
There are no quotes on the macro variable. Where do you see the quotes?
Tom
Super User Tom
Super User

@A-junamu_- wrote:
There are no quotes on the macro variable. Where do you see the quotes?

In the code you posted.

 

%let outpath = "S:/WORKSHOP/EPG1V2/OUTPUT";

A-junamu_-
Fluorite | Level 6

I don't see what you are seeing. This is what I recently posted. 

Ajunamu__0-1654821966283.png

 

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
  • 16 replies
  • 1310 views
  • 0 likes
  • 4 in conversation