Baan BIS
Fill the Empty file add-in Guide

Document information
Document
Document code	: 
Document group	: Development Documents
Document title	:  Fill the Empty file add-in Guide
Edition		: 1.3
Month modified	: August, 2000

© Copyright 2000 Baan Development B.V. All rights reserved 
The information in this document is subject to change without notice. No part of this document may be reproduced, stored or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Baan Development B.V. 
Baan Development B.V. assumes no liability for any damages incurred, directly or indirectly, from any errors, omissions or discrepancies between the software and the information contained in this document. 

Purpose

This document describes a BaanBIS application 'PutSpaceInEmptyFile' that is developed for solving the following problem: Broadbase crashes when a *.txt-file is empty. 

In BaanBIS the export sessions and Exchange schema's do an export from a fixed set of tables. Some customers do not have all of that tables filled (Example: not all customers use financial budgetting). Exporting from an empty Baan table will result in an empty *.txt file. Broadbase can not handle an empty *.txt file to read from and it will crash. 

This correction program PutSpaceInEmptyFile delivers a workaround on this problem: it puts one space character in all empty *.txt files in a given directory. Then the *.txt files are not empty anymore and Broadbase will not crash.

Installation

Copy the file to the folder C:\ or any other path on PC where Broadbase server is installed.

Description

The program has no graphical user interface, there is just a command line interface. This command line interface makes it possible to add this program to the standard Job Runner (from EDM1.3 and onwards) of BIS and make it run automatically (if that fits into the procedure).

Syntax: 
PutSpaceInEmptyFile.exe -DirName <Directory path> [ ‑LogFile <Logfile name> -StatusFile <Statusfile name> ]

where:

Directory path	The directory that contains the *.txt-files that should be checked.	
Logfile name	Path and name of the logfile to be created.	
Statusfile name	Path and name of the statusfile to be created.	

Logfile and Statusfile are optional but are required for running this program from the Job Runner. 

When started the program will check all *.txt-files in the given directory for being empty. 
When empty (containing zero characters) it will write a space character in and save the file. 
It will write logging info to the logfile (when specified) and its status in the statusfile (when specified).
UI-feedback to the user will only be given when no logfile nor statusfile are specified (otherwise a batchprocess will hang on waiting for pressing OK). 

The process about the *.txt-files is of 3 steps:
1.	Data exported by Baan4c and written on the Baan-server
2.	Transfer (= FTP or copy) the *.txt-files to the Broadbase server
3.	Broadbase reads the *.txt-files and writes to the data warehouse.

This correction program should correct the *.txt-files between step 2 and 3. 

In case you have defined a cluster script (like run_B40c) with Maintain Broadbase parameters from the BIS Console then you have to add a call to this program manually into the cluster script (and do it again when the script is regenerated). 
Reason is that step 2 and 3 are executed subsequently from that one cluster script, where the cluster script itself can be scheduled in Job Runner.

Please see an example below where the call to the program is manually added to the cluster (in bold). 

create or replace script "GENERIC"."RUN_B40C" as 
// Cluster: RUN_B40C
// Generated at: 6/8/00 12:02:39 PM
execute method "GENERIC".PollGetBaanFiles.Log('Info','RUN_B40C starts running.');
// The BB code to run schema B4CSST13 starts here.
execute method "GENERIC".PollGetBaanFiles.PollGetFTP('sabine', 'login','password','UNIX','/home/pvalk/sls','C:\Program Files\Baan\BaanDM1.3\Modeler Templates\b4csst13', 5,300) ;
if(sql.wasError()) {
sql.output("Error: Baan files for B4CSST13 couldn't be loaded");
} else {
execute method "GENERIC".RedirectLink.toDir('B4CSST13', 'SST_LINK','C:\Program Files\Baan\BaanDM1.3\Modeler Templates\b4csst13');
if(sql.wasError()) {
sql.output("Error: Couldn't change B4CSST13.SST_LINK" );
} else {
execute method Run_executable.Do_Exec('C:\PutSpaceInEmptyFile.exe -DirName "C:\Program Files\Baan\BaanDM1.3\Modeler Templates\b4cfin13\" -StatusFile C:\Temp\stat.txt -Logfile C:\Temp\log.txt',0);
execute method "GENERIC".PollGetBaanFiles.Log('Info','B4CSST13 Starts running for C:\Program Files\Baan\BaanDM1.3\Modeler Templates\b4csst13');
execute script "B4CSST13".CONTROL_NOPOLL;
execute method "GENERIC".PollGetBaanFiles.Log('Info','B4CSST13 Finished.');
}
}
execute method "GENERIC".PollGetBaanFiles.Log('Info','RUN_SLS is finished.');
/