The
setoutput function redirects the output cases of a batch application to the data file specified in the string expression
file_name. All data will be appended to (added to the end of) the file. If the file exists prior to the application run, you may, depending on the circumstances, want to use the
filedelete function to remove the file.
You can use a single file name as an argument or you can specify a string
List. Using a List allows you to specify multiple output files. Cases will be output to each of the output files specified.
This function cannot be used in data entry applications.
The function returns a logical value of 1 (true) if at least one physical file is successfully assigned and 0 (false) otherwise.
PROC PROVINCE
// split the contents of the input data file into one file for each province code;
// the output files will be put in a directory called "split"
string output_path = Path.concat("split", maketext("%02d.dat", PROVINCE));
setoutput(output_path);