SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

"DATA is in a format that is native to another host," and yet it is not

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

"DATA is in a format that is native to another host," and yet it is not

1) I'm brand new here (and to programing) so sorry if this is in the wrong place.

2) my code keeps coming up with this message: 

 

Data file MYLIB.CEREAL.DATA 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.

However, the data works just fine in my other uses for it. 

In class I brought this up to my professor concerning a different problem set and all I had to do was capitalize some letters inbetween quotation marks, so I think this has an easy fix but for the life of me I can't figure it out. I've been messing with this for the better part of an hour and still it won't come up. I'm attaching a screenshot of what the dataset looks like (in case it's something silly like capitalization again). 

My code: 
%let mgf1 = 'K';
%let mgf2 = 'G';
%let Nutrient = Sugar;
proc ttest data=MyLib.cereal h0=0 alpha=0.05 sides=2 ;
class mgf;
where mgf in('&mgf1','&mgf2');
var &Nutrient;
title '&Nutrient affect on &mgf1 and &mgf2';
run;
title;

Screen Shot 2016-12-01 at 5.53.35 PM.png

Accepted Solutions
Solution
‎12-02-2016 06:54 PM
Super User
Posts: 19,770

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

You have too many quotation marks. You have quotes when you use your macro variables and in your macro variable definition.

 

Drop the quotations marks from the macro variables. 

 

You also need double quotes in your WHERE clause so the macro variables resolve, otherwise they won't. And that's probably why you have no results. 

 

data cereal;
set mylib.cereal;
run;
%Let mgf1=G;
%Let mgf2=Q;
%Let Nutrient=Sodium;
title "&Nutrient affect on &mgf1. and &mgf2.";
proc ttest data=cereal h0=0 alpha=0.05 sides=2 ;
class Mgf;
where Mgf in("&mgf1","&mgf2");
var &Nutrient;
run;

View solution in original post


All Replies
Super User
Posts: 19,770

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

I'm assuming you didn't create this dataset. Since someone else created it, if the created it on a different system you get this NOTE. It's not an issue and shouldn't affect your data.

 

If you want to remove it from appearing, copy your data over to work and use it from there instead.

 

 

/*Brings it into your system*/
data cereal;
set mylib.cereal;
run;

/*writes it back out as your system*/
data mylib.cereal;
set cereal;
run;

And now use cereal instead of mylib.cereal. You shouldn't see the error message anymore.

You could replace the dataset with the one you just created to remove the error entirely.

I think the quotes error is different and relates to 

 

option validvarname = Any/V7. 

 

Occasional Contributor
Posts: 5

Re: "DATA is in a format that is native to another host," and yet it is not

I just tried that. Now I'm getting " No observations were selected from data set WORK.CEREAL."
Super User
Posts: 11,343

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

Please show the complete code you used to copy the dataset and what generated the message about "zero observations". May be a spelling error in the data set name one way or another

Occasional Contributor
Posts: 5

Re: "DATA is in a format that is native to another host," and yet it is not

data cereal;
set mylib.cereal;
run;

%Let mgf1='G';
%Let mgf2='Q';
%Let Nutrient=Sodium;
title "&Nutrient affect on &mgf1 and &mgf2";
proc ttest data=cereal h0=0 alpha=0.05 sides=2 ;
class Mgf;
where Mgf in('&mgf1','&mgf2');
var &Nutrient;
run;

I'm thinking it's something to do capitalization or ; or something silly. Because it wasn't reading the observations when it was in the library either. 

Super User
Posts: 19,770

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

It's possible it's case sensitive, or the library declaration is case sensitive.

 

If you right click the dataset and hit properties one field should have the dataset name. Use that to refer to it. 

Occasional Contributor
Posts: 5

Re: "DATA is in a format that is native to another host," and yet it is not

The thing is, the library worked in a different dataset. It's when I started doing %Let that it doesn't recognize the dataset

Solution
‎12-02-2016 06:54 PM
Super User
Posts: 19,770

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

You have too many quotation marks. You have quotes when you use your macro variables and in your macro variable definition.

 

Drop the quotations marks from the macro variables. 

 

You also need double quotes in your WHERE clause so the macro variables resolve, otherwise they won't. And that's probably why you have no results. 

 

data cereal;
set mylib.cereal;
run;
%Let mgf1=G;
%Let mgf2=Q;
%Let Nutrient=Sodium;
title "&Nutrient affect on &mgf1. and &mgf2.";
proc ttest data=cereal h0=0 alpha=0.05 sides=2 ;
class Mgf;
where Mgf in("&mgf1","&mgf2");
var &Nutrient;
run;
Super User
Posts: 7,760

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to kimmy_m66

As @Reeza already mentioned, you have a problem with quotes. Macro variables are not resolved inside single quotes.

And you should not use any quotes around values when defining macro variables, unless you want the quotes to be part of the macro variable value!

The macro preprocessor only knows the data type text, so quotes are almost never needed.

 

So in your example, your where condition is looking for the values &mgf1 and &mgf2, instead of the intended K and G.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 5

Re: "DATA is in a format that is native to another host," and yet it is not

Posted in reply to KurtBremser

Yes thank you! This was the solution Smiley Happy Got it all figured out before it was due luckily

☑ This topic is solved.

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

Discussion stats
  • 9 replies
  • 388 views
  • 0 likes
  • 4 in conversation