SECTION 22.214.171.124 – SHOP/FUEL BUDGETS ASCII INPUT
USAGE: To import a file containing, all or a subset, changes to the Site Budgets for either the shop or fuel budgets. These can also be changed one at a time using MODIFY OPERATING PARAMETERS (see SECTION 126.96.36.199), however, if you need to setup new parameters for all sites, entering them this way is usually more convenient.
DISCUSSION: Make sure that you have a good backup of your data and that no-one is using Pipeline during the update. Pipeline may not update the files as you expected and the only completely safe way to correct the mistake is to restore your data from backup.
The import file required must be called stnbudmf.csv, although case is not important in Windows. This file must reside in your data directory, eg \PIP3DATA\COMP1. Also, the file must not be in use. This is important because if you have created the file from a spreadsheet and have saved it but not closed it, the file will still be locked by the spreadsheet program and Pipeline will not be able to open it.
The input file must be in CSV format. This is a comma-delimited file (without quotes) with one record per line. Exporting from Excel, choosing the CVS format, will produce the correct format automatically. Numeric fields should not have any dollar signs or commas. Do not use commas in any alpha fields. These will be treated as a field break and Pipeline will not import the row correctly. A blank cell will be treated as a valid entry, thus a blank alpha cell will clear the corresponding field in the master-file and a blank numeric cell will reset the corresponding field in the master-file to zero. Thus if you do not wish to change a field, either delete the row.
Unlike most imports, this program expects a very strict field layout. Specifically, each line must contain a SITE NUMBER and 12 numbers corresponding to the budgets for each period. The first column represents the budget for January and so on.
The very first line must be the header line and must be exactly:
If the first line is not exactly one of the options, as shown above, the program will reject the file. The program will know, from the 1st line, whether you are updating shop or fuels.
An example of a complete shop file is as follows:
An example of a complete fuels file is as follows:
The fields and headers are identical to those exported using SHOP BUDGETS ASCII EXPORT (see SECTION 188.8.131.52). In fact the easiest way to create the initial file is to export it first using this program with the headings option turned on. Note that if you use this method, only export the SITE CODE and BUDGET fields. If you export other data, you will need to delete the superfluous columns before the file can be imported.
1) The order of the columns is not important but they must not appear more than once.
2) CODE must appear, as it is used to link the row to the Site Code as it currently exists on the Site master-file.
3) Apart from CODE, you must have at least one more column.
4) If you try to import the raw file form the ASCII EXPORT program, it will not read in successfully unless you choose to export with comma delimiters between fields and without quotes around fields (numeric and alphanumeric). This can be set in the options part of the export program. Normally this is not the way this function is used, the purpose of this function being to manipulate the file in a spreadsheet program and importing the result.
5) Most fields are not verified on import. You must enter valid information. For the field that are validated, invalid data will be ignored.
When the program starts, it will firstly check whether the import file exists and is accessible. Having established this, Pipeline will read the first line of the file and check for its correctness. If no obvious errors are found, you will be asked to confirm that you have made a backup and then you will be asked to confirm that you wish to proceed.
Pipeline will then read import lines one at a time confirming firstly that the SITE field corresponds to a Site code and then replacing the fields. If an invalid or blank row is encountered, it will be skipped. Pipeline will continue processing until it reaches the end of the import program. Finally the import file will be renamed to stnbudmf.old (to stop you from accidentally rerunning the program with used data) before returning you the MAIN MENU.