BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

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.

 

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

6 REPLIES 6
Reeza
Super User
Are you certain your SAS server is running on a Windows system and not Unix?
Phil_NZ
Barite | Level 11

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.

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Reeza
Super User
Your computer is running Windows but SAS may not be installed on your computer or running from your computer so you cannot assume it's running on the same OS. The commands are passed to the system, run and then the results are displayed on your machine but the actual processing is unlikely to be happening on your desktop. EG and Studio are usually indicators that you are not running locally.

If you run the following, it will indicate the OS your SAS application is running on in the log output, see the blog post for example output.

Proc setinit;run;

https://blogs.sas.com/content/sgf/2016/08/02/two-steps-to-update-your-sas-license-and-check-if-it-is...


FreelanceReinh
Jade | Level 19

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).

ballardw
Super User

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.

Phil_NZ
Barite | Level 11

A very clear example and explanation @ballardw 

I will notice this one when working with my co-authors in the future.

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.

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
  • 6 replies
  • 1878 views
  • 6 likes
  • 4 in conversation