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
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!
That is because _WINS is a view:
data _wins / view=_wins;
Is it only about the display icon or any further notice about that?
Cheers,
Phil.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.