Desktop productivity for business analysts and programmers

How to create single view on multiple table and access it?

Accepted Solution Solved
Reply
Contributor
Posts: 60
Accepted Solution

How to create single view on multiple table and access it?

Hi,

I have two SAS table  one and two.both the table having some same column and some different col.I need to append the data and create a single dataset. on top of that I need to create view on the combine table.

I am using below code but not able to do it.

data join / view=one.join_vw;

set one two;

run;

its throwing an error

ERROR: The requested type of view (Input or Output) cannot be determined.

let me know anyone have any solution for this.

further I need to access the view for different process. can I would be able to access the view as it is created on two different table.

Thanks;


Accepted Solutions
Solution
‎12-15-2014 05:39 PM
Contributor
Posts: 60

Re: How to create single view on multiple table and access it?

I have used below code and it's working fine.

data join_one/view=join_one;

set oil.oil;

run;

data join_two/view=join_two;

set ocb.ocb;

run;

data out.join_vw/ view=out.join_vw;

set join_one join_two;

run;

data join_out;

set out.join_vw;

run;

View solution in original post


All Replies
Respected Advisor
Posts: 3,156

Re: How to create single view on multiple table and access it?

I think you syntax is a bit off,  you can only have ONE name for ONE view, here you are offering two: 'join' and 'one.join_vw'. Try to make them the same:

data one.join_vw / view=one.join_vw;

set one two;

run;

Good luck,

Haikuo

BTW, just to be clear, SAS View is a piece of SAS code, so it doesn't care how many tables involved, when you used it, it also doesn't care if it is sourced from multiple tables.

Solution
‎12-15-2014 05:39 PM
Contributor
Posts: 60

Re: How to create single view on multiple table and access it?

I have used below code and it's working fine.

data join_one/view=join_one;

set oil.oil;

run;

data join_two/view=join_two;

set ocb.ocb;

run;

data out.join_vw/ view=out.join_vw;

set join_one join_two;

run;

data join_out;

set out.join_vw;

run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 792 views
  • 3 likes
  • 2 in conversation