I am working through an problem where I have merged together numerous data sets and am trying to efficiently have SAS select which dataset to assign to a final set of variables. An example of the variables in the data set would be: CoV1 Level1 Light1 Cov2 Level2 Light2 Cov3 Level3 Light3 Currently i am working through the data in a long form way with examples such as IF CoV1 < Cov2 AND CoV1 < CoV3 THEN DO; CoV=CoV1 Level=Level1 Light=Light1 END; ELSE IF CoV2 < CoV1 AND CoV2 < CoV3 THEN DO; CoV=CoV2 Level=Level2 Light=Light2 END; ELSE IF CoV3 < CoV1 AND CoV3 < CoV2 THEN DO; CoV=CoV3 Level=Level3 Light=Light3 END; Obviously this long form programming poses problems problems when the number of merged files grows, I feel like there is a far more efficient way to program this type of decision in SAS, possibly using an array or other tools in the datastep. Basically for each record i am trying to determine the minimum of CoV(1-3) variable and assign the CoV, Level and Light from that data set to the new variables CoV, Level and Light.
... View more