Changing the location of the sample output file

When the Job Queue has processed the sample it will generate the output file and will typically store it in the following default location:

C:\Program Files\MaRSC\Windows\Output\<SQL db name>\Survey_x\Project_y\

The default output file name is:

Batch_batchno.csv

 If the sample is defined as having three replicates, the output files will be called Batch_01.csv, Batch_02.csv and Batch_03.csv.

This example assumes that the output is defined as comma delimited.  If another output option is selected the file extension may be different.

The defaults can be changed for each child database by editing the xmlXML column in table MARSC_XML.

For example, the following xml can be added:

<Output>
    <Folder Database="%DatabaseName%" Survey="Survey" Project="Project"/>
    <File Name="%ProjectName%_%BatchNo%_%Count%"/>
</Output>

This will change the default folder location to:

C:\Program Files\MaRSC\Windows\Output\<SQL db name>\Survey\Project

And the file name to:

Samplename_batchno_count.csv

 If the sample is defined as having three replicates, the output files will be called  My Sample_01_334.csv, My Sample _02_334.csv and My Sample _03_332.csv, where the count shows the number of records in each replicate batch, in this example, the total sample contains 1000 records.

The following substitutions may be used in the xml:

  • %DatabaseName%
  • %ExternalID%
  • %ProjectID%
  • %ProjectName%
  • %SurveyID%
  • Metadata can also be used. Metadata variables are delimited using $
  • Prototype Name cannot currently be used as a substitution
Note that Windows file names cannot contain certain characters, such as ‘\’ (backslash) and ‘*’ (asterisk), therefore invalid characters will be replaced by underscores ‘_’ in the folder and filenames.

Example XML

The example below shows the complete xml including the output definition used above.

<DBConfig>
    <Child Type="Panel">
	<SampleJob>
	    <ReinterviewRules ProjectMonthsAreDays=""/>
	</SampleJob>
	<Survey>
	    <Default>
		<SampleSpecification>
		<Output ModeID="2" FormatID="1">
		<Detail Separator="44">
		<Column Name="chUnique_Ref_No" Table="MaRSC_Contact_History"/>
		<Column Name="cusCustomer_ID" Table="MaRSC_Customer"/>
		<Column Name="Matrix_Cell_ID" Table="MaRSC_List_Final"/>
	</Detail>
	</Output>
	<MarginalsAsPercentages>1</MarginalsAsPercentages>
	</SampleSpecification>
	</Default>
	</Survey>
	<Output>
	    <Folder Database="%DatabaseName%" Survey="Survey" Project="Project"/>
	    <File Name="%ProjectName%_%BatchNo%_%Count%"/>
	</Output>
    </Child>
</DBConfig>

Some installations may choose to stop the Job Queue producing the output file, this can be done by adding the setting <SuppressOutput>0</SuppressOutput> to MARSC.cfg.

The output file can be generated at a later stage using the Sample Action/Output option.  The generated file can then be saved to a location chosen by the user.