Go to home page - New Zealand Food Safety Authority.
Page content. Site access keysMain Menu
| Advanced Search
Te Pou Oranga Kai O Aotearoa

 
 
 

Animal Products E-cert Help Files

Easy batch file tutorial

The following guidelines assume that you already know how to complete and submit an Eligibility Document on the NZFSA E-cert system. It also assumes that you have a reasonable knowledge of PC functions and how to locate and save files.

If you have not progressed this far you need to get different help

For help with E-cert and submitting Eligibility documents, use the E-cert Help Files on the NZFSA web site.

E-cert training is provided by the Seafood Industry Training Organisation (SITO).

Phone 04 385 4005
Email sitoadmin@seafood.co.nz
Website www.sito.co.nz

For help with knowledge of PC functions, a course at polytech or something similar may be useful.

Setting up Batch File Templates

At first glance, batch files look hard to follow and understand. However, it is not so important that you understand how they work – they can be very useful particularly if you are doing many certificates that have similar information:

Same product type

Same market or customer

Same method of transfer/export.

There are two ways to set up a batch file – the hard way and the easy way!!

The hard way is explained, with examples, in the Batch Files section of the E-cert Help files. This method is for those people who want to understand how to set up a batch file from scratch.

The "easy way" has been made possible through E-cert. Steps 1 to 6 are about setting up batch file templates; steps 7 to 12 are about using these templates.

 

Step

Detailed Explanation

Notes

1.

Prepare and submit a certificate using the on-line certificate form.

Use the Training site to create a certificate (alternatively go to an existing certificate you have created in the Live site and go to step 3).

If you can’t do this yet, don’t try the batch file.

2.

Click on the Data View button.

All the certificate information will now show on screen in batch file format (XML).

You can’t edit or change this file but you can copy it and save it.

3.

Click the right mouse button. Then click View Source from the menu that appears.

This will copy and paste all the information on screen to a Notepad file. Notepad will open automatically. 

Manual Copy and Paste commands can also be used. Follow these steps:

Ctrl + A - to select (highlight) the whole page;

Ctrl + C - to copy the page;

Open Notepad - click your Windows Start button, > Programs > Accessories. Notepad should be in the Accessories menu.

Ctrl + V - to paste the file into Notepad.

Notepad is a very simple software application that will be present on all PCs with Windows. It is ideal for batch files because it does not have formatting commands to "get in the way", like you get with Word.

You can use other applications such as Word or Excel, but you need to know how to save the result as a .txt file to do this!

4.

Edit the file to create a template

In order to raise the batch file online the following tags need to be added to the top and bottom of the file:

<batch_request>

<raise_eligibility_document>

ED data

</raise_eligibility_document>

</batch_request>

Comments can be placed within a template on any line by using the following tags.

<!-- Comment -->

Other methods can also be used. ie <raise_export_certificate>

5.

Save the Notepad file, using a name for the file that you will be able to recognise later eg Hoki_US.txt

The Notepad batch file can then be used, with some minor changes, as the basis for many other similar certificates.

 

6.

Organise your template files

Take some time to think about how you want to store your batch file templates. Set up a directory (and sub-directories) on your computer that allows easy identification and retrieval of the batch file templates.

Make sure that your computer is backed up regularly.

7.

Use your batch file as a template to create a new certificate.

When you want to use one of your templates for a new certificate, there are a minimum number of fields that must have information in them before the file can be successfully submitted. These include all the compulsory (pale blue) fields plus some others that will be necessary to get the certificate approved:

Certificate number

Consignor

Consignee

Transport mode

Carrier name

Date of departure

Product description (including at least 1 check box, eg human consumption)

NZHS code

Species

Eligible countries

Number of cartons

Package type

Net weight

At least one process including the number of the premises that processed it.

Use the Save As command to save the file under a different name. For example, using the Certificate Number.

You change the file in Notepad, making sure that, if nothing else, the Certificate Number is changed, a new submission required a new certificate number to be successful.

8.

Enter E-cert and click XML Batch File

XML Batch File is located under New Certificates on the left-hand menu.

Try this only on the Training site until you are sure of what you are doing.

9.

Click Browse and locate the file in your computer directory.

Double Click on the file you want to use, or click Open.

OR - Enter the file name and path of the batch file you want to use.

 

10.

Click Submit

If there are any problems with your batch file, an error message will come up detailing what is missing or wrong.

You then need to go back to Notepad and make the necessary changes and submit the file again.

 

11.

Edit the file as required then re Submit.

Once the certificate has been successfully submitted, you are able to Edit the contents while it is still in the Raised, Amended or Resubmit status. Unless the status is Resubmit, editing must be done using the on-line certificate however, not the Notepad file. Once it has been Approved by NZFSA, you can no longer make any changes but you can Request Amendment of an ED or Request Replacement of an export certificate that NZFSA will action.

 

Batch File Frequently Asked Questions

Charges & Fees:

There is no charge to use the “XML Batch file” button.

There is no charge to use the “XML Batch Status” button to check if batch files have been processed.

There is no charge to delete processed XML batch files.

Indents or spaces are not required, also XML tags can all be on the same row, but using the standard E-cert structure makes it easier to read.

Multiple country codes can be listed on one line (with space in between).

<Classification>

<Class code="CA BE ZE US"/>

<Type code="CC"/>

</Classification>

Multiple product declaration codes can be listed on one line (with space in between).

<Classification>

<Class code="FR IN LI"/>

<Type code="DC"/>

</Classification>

Any free text comments can be put on any line within the file eg

<ConveyanceRef>12345</ConveyanceRef> <!-- Comment always use Ref 12345 -->

XML Batch files are currently processed every minute so depending on when the file is submitted it should only ever take a maximum of one minute or less to process.

XML editors such as notepad ++ are available for free download from the internet which makes editing and error checking much easier than using notepad or wordpad.

XML can often be displayed in more ways than one using different tag or line configurations. You may find that there are some shortcuts or ways of putting lines of data in your XML file that are slightly different to the way it was shown in this document and that E-cert will still accept.

If the full eligibility document number is used in the XML file always put a T at the end of it.

< EligibilityDocument number="NZL2009/TEST604/78031T">

Alternatively just the document number can be inputted as shown:

<EligibilityDocument number="78031">

There are two kinds of errors a User might encounter when submitting a XML batch file:

1) Parser errors – incorrect syntax of the XML file

XML parsing error: mismatched tag at line 516, column 11, byte 20780 at /opt/perl/lib/site_perl/5.8.3/PA-RISC2.0-LP64/XML/Parser.pm line 187

Solution: review batch file tags and elements, error probably occurred on line 516 of file.

2) E-Cert Business Rule errors – the xml file contains incorrect or missing data which is required by the E-Cert system. Validation rules within the system will highlight the area of concern.

Solution: review batch file data, error message will point to the problem.

All information on this website is subject to a disclaimer.
Contact for enquiries

New Zealand Food Safety Authority
68-86 Jervois Quay
PO Box 2835
Wellington
NEW ZEALAND

Phone: +64 4 894 2500
Fax: +64 4 894 2501

Contact NZFSA about this page