By the by, how can I change the data structure of "p2004_usa" to long-structured through proc sql and vice versa?
Use Proc Transpose or a Data step.
Generally, PROC SQL isn't a good way to transpose data.
How do you map these ar1 ,ar2 ....... into US0010311035 US00163U1060 .. ? they have the exactly same order ?
I got ar1, ar2 from another calculations. Yes, they are in same order: ar1, ar2, ar3,........
Add this
options dkricond=nowarn dkrocond=nowarn ;
before data step.
Same as before. Now the output dataset has only 'Date' variable. Other variables are gone.
To limit your data you can use a WHERE statement in a data step or proc, assuming you have a SAS date.
e.g.
where year(date)=2004;
How to use the data set decile? That depends on how you want to use it. I suspect you'll need to merge it in but you'll have to provide a sample input/output for more detailed help.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.