creating variable from multiple variables
I have 8 variables that contain string data, the string data are ICD-9 codes and what I am attempting to do is create a variable based on the first recorded diagnosis code indicating a head injury. some of the cases have multiple codes representing the head injury but I would like to use the first one recorded. so for example if in dx1 is 310.2 and then dx2 is 854.00 I would like to use 310.2 because that is the first reported head injury code. here is what the data looks like: I used the IF ANY command but it continued to read subsequent head injury codes. any help with this is greatly appreciated. AKR.
dx1 dx2 dx3 dx4
780.2 959.01 E91.78
959.01
850.9 803.00 784.0
959.01
873.42 959.01
780.2 920. 923.03 850.9
959.01 724.8 E88.59 E91.78
959.01
V70.5 723.1 V15.59_0
850.0 465.9 E92.74
309.9 959.01 E95.88
850.5 780.93 339.20 782.0
959.01 389.10
959.01
850.0 E91.79
919.8 920. 959.01
850.0
959.01
850.9
850.11 920. 922.31 719.46
959.01 924.8 782.3
959.09 959.01
V70.5 V15.59_2
805.4 959.01
850.11 912.0 E81.22
V70.5 V15.59_0 782.1
300.01 959.01
726.5 844.9 728.71 V15.59_0
959.01 473.9
V70.5 V15.59_0 V15.88 780.99
V49.89 V68.9 V15.59_1 V65.49
847.2 724.8 V15.59_0 E92.89
784.0 V70.5 V15.59_B
854.00 847.2 389.9
V70.5 V15.59_0 724.2 719.40
850.9
850.11 V15.59_2 V70.5 719.41
726.61 V15.59_0 V43.64
V70.5 V15.59_0 V62.81 V15.89
V70.5 V15.59_0 311. V62.81
V70.5 844.0 V45.89 V15.59_0
847.1 728.85 E92.70 V15.59_0
850.0 372.72 920. 922.9
873.40 850.5 910.0 881.01
805.05 959.01
V70.5 303.90 V15.59_1
840.9 850.9 E81.29
723.1 854.00
959.01 E91.70
959.01
V70.5 V15.59_0 311. 787.91
719.42 V15.59_0
339.22 V15.59_2 780.93 V70.5
850.0 847.0 723.1 724.5
V70.5 V15.59_0 V15.88 311.
719.46 V15.59_0 305.1
905.2 717.9 704.8 V15.59_0
959.01
718.31 V15.59_0
786.52 V15.59_0
850.0 V15.59_2 V70.5 E97.92