I am looking for a way to compare multiple observations and output a file that contains the final number from multiple part number change observations.
The data haveSorted below i have ordered only for ease of seeing how the part numbers are stored. The actual data I have is not sorted in any way.
Any recommendations would be greatly appreciated as I have been unable to think of a method to do this.
DATA haveSorted;/*Manually sorted for ease of understanding*/
infile datalines delimiter=",";
input prev_part $ part_sup $;
datalines;
.,X1
X1,P2
P2,P5
P5,D3
.,4C3
4C3,7S2
7S2,6BW
.,5S2
.,6R1
6R1,3F3
3F3,24X
;
DATA have;
infile datalines delimiter=",";
input prev_part $ part_sup $;
datalines;
.,X1
X1,P2
3F3,24X
P2,P5
4C3,7S2
P5,D3
.,4C3
7S2,6BW
.,5S2
.,6R1
6R1,3F3
;
data want;
infile datalines delimiter=",";
input prev_part $ part_sup $ final_part $;
datalines;
.,X1,D3
X1,P2,D3
P2,P5,D3
P5,D3,D3
.,4C3,6BW
4C3,7S2,6BW
7S2,6BW,6BW
.,5S2,5S2
.,6R1,24X
6R1,3F3,24X
3F3,24X,24X
;
... View more