I have a dataset with a lot of observations. A variable of observation is a number. I want to replace this number with another one. Which number is the correct replacement is in a separate file (which can have chances over the years). My previous solution is that I wrote every possible substitute in the code: if XYZ = 98765 then
do XYZ = 12345;
end;
if XYZ = 98764 then
do XYZ = 12345;
end;
if XYZ = 98763 then
do XYZ = 12346;
end; The datafine is *.txt and looks like this: 98765;12345 98764;12345 98763;12346 198763;12346 and so on (yes, the first variable is some times 5 digits, sometime 6 digits. the second is allways 5 digits) I would like a solution in which my program reads the * .txt file every time I start the program and replaces the specific value within the 150,000 observation. The program reads the dataset with: data QWERT;
infile 'C:\data\project\qwert.txt' lrecl=410;
input @20 XYZ 6.;
/* some other stuff happening that is not relevant for the challenge */
run; I was thinking of some kind of loop while reading the file and than a replacement routine. But I dont really know how to start. I am using SAS Enterpirse Guide 7.12 HF8 (German Version)
... View more