for each ttUD101A:
if not can-find(UD18 where UD18.Company = ttUD101A.Company and UD18.Key1 = ttUD101A.Key1 and UD18.Key2 = ttUD101A.ChildKey1 and UD18.Key3 = ttUD101A.ChildKey2 and
UD18.Key4 = ttUD101A.ChildKey3 and UD18.Key5 = ttUD101A.ChildKey5) then do:
create UD18.
assign UD18.Company = ttUD101A.Company.
assign UD18.Key1 = ttUD101A.Key1.
assign UD18.Key2 = ttUD101A.ChildKey1.
assign UD18.Key4 = ttUD101A.ChildKey3.
assign UD18.Key5 = ttUD101A.ChildKey4.
assign UD18.Character01 = ttUD101A.Character01.
end.
end.
if not can-find(UD18 where UD18.Company = ttUD101A.Company and UD18.Key1 = ttUD101A.Key1 and UD18.Key2 = ttUD101A.ChildKey1 and UD18.Key3 = ttUD101A.ChildKey2 and
UD18.Key4 = ttUD101A.ChildKey3 and UD18.Key5 = ttUD101A.ChildKey5) then do:
create UD18.
assign UD18.Company = ttUD101A.Company.
assign UD18.Key1 = ttUD101A.Key1.
assign UD18.Key2 = ttUD101A.ChildKey1.
assign UD18.Key4 = ttUD101A.ChildKey3.
assign UD18.Key5 = ttUD101A.ChildKey4.
assign UD18.Character01 = ttUD101A.Character01.
end.
end.