/* EXPORT.mffm version 1.1 */ /* This macro must be run from within the MFF citation database from */ /* which you wish to export citations. It writes a text file with */ /* each field (line) of each record/citation on a separate line. */ /* make sure some records are selected */ options results; options failat 20; first; if (rc ~= 0) then do display "You must select some records to export!" exit; end; /* open the text file for export */ screentofront(); out_text = getfile(,,'ram:',,'Select export file name'); if (out_text = '') then exit; if (open(exportfile,out_text,'W') ~= 1) then; do; screentoback(); display 'I could not open the file ' || out_text || ' for exporting.'; exit; end; /* get the first record */ get rec; /* read all of the records in the database and export them */ do while (rc = 0); j = 1; do j = 1 to 5; say rec.j.value; foo = writeln(exportfile,rec.j.value); end; /* get the next record or exit from macro */ next; if (rc ~= 0) then; do; screentoback(); display 'Exported citations in file ' || out_text; exit; end; else; get rec; end;