Either you can use the VTS to capture the data or use a flat file to write it.
For second option here are high level steps
1.Create a flat file on a path where you script can access.
2.Open the file from vugen script in append mode.
3.Capture the data you want to capture through parameter.
4.Write the parameter to flat file
at the end you have all data you needed. Here is a sample code
char *FileName = "filepath\filename.txt";
int iDocLength;
long DocFileOpen;
iDocLength = strlen( lr_eval_string("{paramname}") ) + 1;
//write the quote number in to a flat file
DocFileOpen = fopen( BillDocFileName,"a+" );
if(BillDocFileOpen == NULL){
lr_log_message("Unable to open and write in doc file");
}else
fwrite( lr_eval_string("\n{gettingBillDocNo}"),iDocLength,1,DocFileOpen );