There are a number of problems with the application you sent. As I mentioned before, the arguments to the command loadcase must the be id-items for the external dictionary. In your application NAME, SEX and AGE are not id-items. They are regular data items therefore you cannot use them as keys for the lookup. Secondly you are using D1_DICT as the first argument to loadcase which is the name of the main dictionary and connot be used in loadcase which expects the name of an external dictionary.
I modified your application to use the ID item as the key for the lookup and moved it to the proc for the id item. Now when you enter the id, it loads the case from the second data file with the same id and fills in the name, sex and age fields.
PROC D1_ID
if loadcase(D2_DICT,D1_DICT.D1_ID) <> 1 THEN
errmsg("Failed to find case");
else
D1_DICT.SEX = D2_DICT.SEX;
D1_DICT.AGE = D2_DICT.AGE;
D1_DICT.NAME = D2_DICT.NAME;
endif;
A working example is in the attached zip file. Enter 1 or 2 for the id item and it will fill in the other fields.
You do not have the required permissions to view the files attached to this post.