Hi all SAS Users,
Today, when merging two datasets by using proc SQL (I do not use hash object thingy because it is quite a bit complex to me at this moment).
My code is as below
data origin / view=origin;
set my.keepvar_1999_2001_1;
_seqno=_n_;
run;
proc sql;
create table matching (drop=_seqno) as
select a.*, ex_rate
from origin a left join currency b
on a.CURCDD = b.CURCDD & a.DATADATE=b.DATADATE
order by _seqno;
quit;
And the log is as below
NOTE: DATA STEP view saved on file WORK.ORIGIN.
NOTE: A stored DATA STEP view cannot run under a different operating system.
First of all, regarding the operating system (OS), I took a look at a comment from the previous post by @Reeza
"I'm guessing you're using the wrong encoding option here, is the file created and being used on the same OS or are you crossing OS and languages here? For example, is it created out of a Unix System and read on a Windows System?"
I can say I run all of them on a Window system.
Secondly, I did a search about the document about this line of note, this documentsas just mentioned this line of code and no further explanation. So, I am wondering if I need to care about that note.
Warm regards.
This note
NOTE: DATA STEP view saved on file WORK.ORIGIN.
NOTE: A stored DATA STEP view cannot run under a different operating system.
is a reminder and you don't have to "fix" anything.
The concern is that some people will think a "view" is the same as a "data set". The View contains instructions on how to do something, in this case extract observations from your Keepvar data set. Some people try to copy views and send then to coworkers. If the coworker is running a different operating system then it will not work. If you think about the instructions as "fetch things from the library I defined" then you can see where the connection of the operating system can be important since sets are different and the instructions in a different operating system aren't likely to run locally.
For extra added confusion you can actually use a data step that reads an external file to create view. As long as the external file is there when you use the view the file gets read. So since file paths would differ between operating systems that part can't work.
Hi @Reeza
Sorry if my limited knowledge confuses you. From my point of view, I run all of the code or else on a computer running on a computer using Windows operating system. Other than that, I have no idea so far.
If you do not satisfy with my answer, please let me know how to validate the OS stuff from my computer or else?
Warmest regards.
Hi @Phil_NZ,
Don't let that note bother you. You've created the DATA step view in your current WORK library just for the purpose of creating a temporary sort key for the subsequent PROC SQL step -- and that's what it does. You wouldn't even think of copying the origin.sas7bvew file (before it's deleted by closing the SAS session) to a permanent directory on a different computer with a different operating system and try to execute the view from a SAS installation there (where most likely neither dataset keepvar_1999_2001_1.sas7bdat exists nor libname my is defined).
This note
NOTE: DATA STEP view saved on file WORK.ORIGIN.
NOTE: A stored DATA STEP view cannot run under a different operating system.
is a reminder and you don't have to "fix" anything.
The concern is that some people will think a "view" is the same as a "data set". The View contains instructions on how to do something, in this case extract observations from your Keepvar data set. Some people try to copy views and send then to coworkers. If the coworker is running a different operating system then it will not work. If you think about the instructions as "fetch things from the library I defined" then you can see where the connection of the operating system can be important since sets are different and the instructions in a different operating system aren't likely to run locally.
For extra added confusion you can actually use a data step that reads an external file to create view. As long as the external file is there when you use the view the file gets read. So since file paths would differ between operating systems that part can't work.
A very clear example and explanation @ballardw
I will notice this one when working with my co-authors in the future.
Warm regards.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.