MayFlower develops specialty software products for Lotus Notes & Domino.




Chapter 3 - Example #1: ASCII to Notes
Table of Contents


Loading a Parent Document with Fixed-Length ASCII data

In this example, you will load a Customer Information database (C:\Sentinel\Customer.nsf) provided with Sentinel that has five fields in a Customer Profile Form. From the Notes Main Menu, use File.....Open Database to open the C:\Sentinel\Customer.nsf application on your Notes Workspace.

The fixed length ASCII file that has been supplied as the source file is titled C:\Sentinel\Customer.txt.

Open the Sentinel Task Database
1. From the Notes Workspace, double click on the Sentinel Tasks application icon.

2. If this is the first time you have opened the application, you are placed in the About Database document. Press ESCAPE to close this document.

Navigate to the Task View

The Default View for the Sentinel Tasks application is titled 1. Task\1. Sources and Destinations. This View will allow you to review all Tasks by their destinations Notes database names.

2. Switch to this View titled 1. Task\1. Sources and Destinations. This View lists all Task Documents you create. There are no documents in the View. You will now create the first one to catalog the C:\Sentinel\Customer.txt source file.



Composing an ASCII Task Document

To compose an ASCII Task Document:

1. In the Sentinel Application, choose Compose 1. Task\1. ASCII to Notes from the Notes Main Menu.

2. The ASCII Task Document will appear on screen.

Naming the Task

1. Enter the Name or Title of the Task for display in the view. The title should reflect the nature of the data file (i.e. Customer Name & Address Information for the example we will use). Enter Customer Name & Address now.

2. Enter a description of the ASCII file. The description should accurately describe the ASCII File (i.e. First ASCII task for Your Name). Enter First ASCII task for Your Name now.

Source File Information

Use this section of the form to identify where the Source File is located.

1. Enter the name of the Directory where the source file is located. In our example, we will use C:\Sentinel. Enter C:\Sentinel now.
Directory C:\SENTINEL

2. Enter the File Name you will load. In our example, we are loading Customer.txt. Enter CUSTOMER.TXT now.
File Name CUSTOMER.TXT

3. ASCII Type. Indicate the ASCII Type of file you are loading. Choices are Structured Text, Length Defined, 1-17-20-n, Comma Delimited, and Primary Key/Body. Other formats will be explained in the Examples that follow. For this example we will be loading Customer.txt which is a length defined format. Select Length Defined now.
ASCII Type Length Defined


4. Record Delimiter. Form Feed or Other. Make sure the Form Feed button is selected.
Delimiter Form Feed

5. Field Types. Enter all of the field names in the document with their type and, for length defined, their length. Separate field name, type and length with a colon. In our example, we will be loading the Customer.txt ASCII source file which is length defined. Enter the following values for Field Types now:
Field Types
CompanyName:TEXT:30
CompanyAddress:TEXT:30
CompanyCity:TEXT:20
CompanyState:TEXT:2
CompanyZip:TEXT:5


Notes Destination Database

Use this section of the form to identify the Notes Destination Database.

1. Server Name. Enter the name of the Notes Server the Notes Destination Database is located on. In our example, we are loading a database that is located on the local drive. Enter LOCAL.
Server LOCAL

2. Database Name. Enter the full path and name of the Notes Destination Database. In our example, we are loading the Customer.nsf database. Enter C:\SENTINEL\CUSTOMER.NSF in this field.
Database C:\SENTINEL\CUSTOMER.NSF

3. View Name. In our example, we have developed a View titled Customer in the Customer.nsf Notes Application we are going to load data into. Enter Customer in the View name field.
View Customer


4. Key Fields. Enter the key field(s). For our example, we are loading a Customer Profile form and the key field is CompanyName. Enter CompanyName now.
Key Fields
CompanyName

5 . Form Name. Every Notes Destination Database must have a form to load data into. In our example, we will be loading data into a Customer Profile form that has the Alias Name Customer. Enter Customer in the Form Name field.
Form Customer

6. Document Type. Indicate the type of document you are loading in the Notes Destination Database. Choices are Document or Response. For our example we are going to be loading a Document titled Customer. Select Document now.
Document Type Document

7. Import Type. Indicate the type of transport load you want to run. Choices are Add All, Add Unique, Update, and Sync Databases. For our example we are going to initialize a database and will use the Add Unique and Update selection. Select Add Unique and Update now.
Import Type Add Unique, Update


Saving the Task Document

1. Press the Escape Key and then press the Enter Key to Save the ASCII Task Document

2. The ASCII Task Document is now available in the 1. Task\1. Sources and Destinations View .


Task Options

Use this section of the form to select the different options available for the Task.

1. Log Messages. Choose whether you want to see All Messages or Error Messages Only in the Sentinel Event Log (View....3. Logs\1. Messages By Time). For our example load, we will use All Messages. Make sure All Messages is selected now.
Log Messages All Messages

Review

To review:

1. You created an ASCII Task Document to initialize a Notes Customer Database titled Customer.nsf.

2. You named the task, provided a description, identified the ASCII Source File and the Notes Destination Database.

3. You selected options that defined the file type and the fields.

You are now ready to run the Sentinel Engine and load data from Customer.txt into the Customer.nsf Notes Destination Database.

To begin importing the data, make sure the Task Document that you just created is open on your screen. Click the Run Now button to instruct the Sentinel Engine to execute this Task.