Newbie to sas with a question
data borrower (keep=ln_no id_no);
set table1;
run;
sample data
ln_no id_no
1111 00000
1112 00000
1113 00002
1114 00006
1115 99999
1116 99999
I want to be able to show the data like this
id_no first_ln_no second_ln_no
00000 11111 11112
00002 11113
00006 11114
99999 11115 11116
There can be up to 5 scenarios where one id_no could have several ln_no. Would I need some type of do until statement
I'd probably try PROC TRANSPOSE first.
cynthia
Your solution worked lik a charm. Here is a sample code and output
proc transpose data=borrower out=borrower2
(drop = _NAME_ _LABEL_) ;
id ln_no
by id_no;
var ln_no;
run;
sample output
id_no 11111 11112
00000 11111 11112
Is there a way to assign label to the value as a header. What happens is I get the actual data as both a header and in the detail
I think I figured it out, just use idlabel
Just for clarification: You sample data shows ln_no with 4 characters but the desired output the variable has 5. Is that by chance an error in pasting the sample data?
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.