Hi. I’m reading a file with only two variables, id1 and id2. The file has parent id's that can split into multiple child id's and a child id can further split or produce another child id. There is no link on these records other than id2 can appear as id1 in a subsequent record. I would like to end up with a flattened dataset as the example below. Can you suggest the best way to get this accomplished? Thanks in advance. data have; infile datalines delimiter=','; input id1:$16. id2:$16.; datalines; 1909307070100103,1909307070103065 1909307070100103,1909307070103064 1909307070100171,1909307070103061 1909307070100171,1909307070103060 1909307070100196,1909307070103088 1909307070100196,1909307070103089 1909307070100196,1909307070103090 1909307070100196,1909307070103091 1909307070100201,1909307070103106 1909307070103061,1909307070103117 1909307070103062,1909307070103105 1909307070103065,1909307070103087 1909307070103067,1909307070103104 ; run; Want id1 id2 id3 1909307070100103 1909307070103065 1909307070103087 1909307070100103 1909307070103064 1909307070100171 1909307070103061 1909307070103117 1909307070100171 1909307070103060 1909307070100196 1909307070103088 1909307070100196 1909307070103089 1909307070100196 1909307070103090 1909307070100196 1909307070103091 1909307070100201 1909307070103106 1909307070103062 1909307070103105 1909307070103067 1909307070103104
... View more