Best way to append selected records

What is the best way to append selected records programmatically from one file to another file? Pan6 used OpenFile, and only selected records from the external file were appended. PanX appends the entire database.

Check out the new Importdatabase statement that has the option to import only selected records.

Thank you.