This is my code where I first pull the data usin PROC SQL.
select c.* ......, order1, order2
from table1 a
join table 2 b
on a.id=b.id
join table3 c
on b.cd= c.cd
PROC SORT DATA=s_tmp OUT= s_sort nodupkey;
BY id , cd ;
RUN ;
And my data looks like this:
ID Code seq_no1 seq_no2 Order1 Order2
1 A 1 1 seq_no1 seq_no2
1 A 2 2 seq_no1 seq_no2
1 B 2 2 seq_no2 seq_no1
1 B 1 1 seq_no2 seq_no1
So now within an ID , I have different codes, so I want to first order by Code(eg A,B) and then Order by the values in column Order1 and Order2.
So Order1 has Seq_no1 for Code A, so within Code A , I would like to order by Seq_no1 and then by Seq_no2. However within code B, first I need ot order by Seq_no2 and then by seq_no1.
So a simple 'order by Order1' will not work here. Can u help me with using proc compare of a merge here?