Okay, it is beginning to look and sound less like a homework problem. Thus, a couple of points: 1. you don't need to create the variable obs in each of the files. 2. you don't need and output statement in either datastep. All of the records will be output, with or without the statement. 3. If you need to scan for the second column, don't scan for the last column. i.e., instead of using: file2_&seed=input(scan(_infile_,1,,'bs'),best12.); use file2_&seed=input(scan(_infile_,2,,'s'),best12.); 4.Don't use: data class; merge class1_&seed class2_&seed; by obs; Run; You only want to merge the each line of the one file with its corresponding line from the other file. Just use: data class; set class1_&seed; set class2_&seed; Run;
... View more