Depends a little how you are opening the A file. Below is one idea how you could approach this:
Names Default To Here(1);
dt_A = Open("$SAMPLE_DATA/Boston Housing.jmp");
a_path = Convert File Path(dt_A << get path);
folder_path = Substr(firstTable, 1, Contains(firstTable, "/", -1));
b_path = folder_path || "B.jmp";
c_path = folder_path || "C.jmp";
-Jarmo