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,

 

This morning when I running the code suggested by @FreelanceReinh 

data winsorize;
input Type $ INDC3 $ Year var1 var2;
cards;
AXX CNSTM 1994 0.01 0.08
MAS CNSTM 1996 0.05 .
RAF CNSTM 1994 0.07 0.08
AGG CNSTM 2004 0.07 .
CCC CNSTM 1996 0.02 .
RBB ENEGY 1998 0.05 0.88
RFB ENEGY 1999 0.06 0.89
TYB ENEGY 2018 0.05 0.48
;

data industry_return;
input INDC3 $ Year var3;
cards;
CNSTM 1988 1.2
CNTSM 1989 1.3
CNTSM 1990 1.5
CNTSM 1994 1.1
CNTSM 1996 1.7
CNTSM 2004 1.9
CNTSM 2018 2.1
ENEGY 1988 3.3
ENEGY 1996 3.5
ENEGY 1998 3.9
ENEGY 1999 4.2
ENEGY 2018 4.4
;

data _wins / view=_wins;
set winsorize;
_seqno=_n_;
run;

proc sql;
create table matching(drop=_seqno) as
select a.*, var3
from _wins a left join industry_return b
on spedis(a.indc3, b.indc3)<=10 & a.year=b.year
order by _seqno;
quit;

The result is like that

 

My97_0-1613593192854.png

Can I ask what does the top right blue button of _WINS dataset mean? Because normally in the dataset in SAS EG, I see the right bottom red dot as in the MATCHING dataset.

 

Good morning and 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
Reeza
Super User
A view is dynamic so what really happens is the code included in the view is run when you try and access that table. This is useful as it doesn't take space and will be updated when called.

It's not a static table with values that are constant, that would be a table.



View solution in original post

4 REPLIES 4
Phil_NZ
Barite | Level 11

Hi @Kurt_Bremser 

Is it only about the display icon or any further notice about that?

 

Cheers,

Phil.

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.
FreelanceReinh
Jade | Level 19

Ideally you insert this line before the QUIT statement in the PROC SQL step:

drop view _wins;

This deletes the view (including the unfamiliar icon in your explorer window), which is no longer needed anyway.

Reeza
Super User
A view is dynamic so what really happens is the code included in the view is run when you try and access that table. This is useful as it doesn't take space and will be updated when called.

It's not a static table with values that are constant, that would be a table.



SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1910 views
  • 3 likes
  • 4 in conversation