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?
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.