Defining the Customer File Structure

To begin, we will specify fields that will hold the various kinds of information about our customers. We will decide how many characters each field will contain, and the “edits” (field types) they should have.

PLEASE NOTE: If you have skipped the Sneak Preview and want to start with Lesson 2, the filePro Plus tutorial files must be installed on your system. If you have not installed the tutorial files, please reinstall filePro Plus and select the option to install the tutorial files. You can then continue with Lesson 2.

1. With the main menu displayed, select “1 - Define Files”. The following menu is displayed:

image\fig2-1.gif

Figure 2-1. File Selection Window

2. The window centered on your screen contains the names of the existing filePro Plus files available to you. You can now choose a file by using the arrow keys, or create a new file by selecting “[NEW]”. (You can also select a file by entering its name.) We are going to create a “new’ file.

3. Move the highlight to “[NEW]”, then press <RETURN>. The file selection window disappears. Now type the file name "cust" as indicated in Figure 2-2.

image\fig2-2.gif

Figure 2-2

A menu appears, asking if this new file is going to be a filePro Plus file, or non-filePro Plus file. (In order to use a non-filePro Plus file in filePro Plus, the data must be in ASCII format with fixed-length fields).

image\fig2-3.gif

4. With the highlight on option “1”, press <RETURN> to select a "filePro" file.

5. The next prompt gives you the opportunity to enter a “creation” password for this file. A creation password guards against unauthorized access to the file structure and formats of a file. This creation password will be required by any of the “creation” options on the left side of the filePro Plus main menu when working on this file. filePro Plus also lets you setup “runtime” passwords which prevent unauthorized access to the file data.

image\fig2-4.gif

Press <RETURN> for no password (remember that a <RETURN> in response to a “Yes/No” prompt means “No”). If you choose to create a password, be sure to pick one that is easy for you to remember. filePro Plus displays the screen for defining our file structure:

 

image\fig2-5.gif

Figure 2-5. Define Files screen

filePro Plus STANDARD EDITING KEYS

The following editing keys are available throughout the filePro Plus creation programs. (Some creation programs have additional keys for special editing functions. Those keys and their functions will be displayed at the bottom of the appropriate screen in each program.)

 

 

KEY (DOS)

FUNCTION

 

 

 

 

<ESC>

Record the current file, screen, format, table, etc.

 

Insert or <Fl>

Insert a character space

 

Delete or <F2>

Delete a character

 

<F3>

Insert a blank line

 

<F4>

Delete a line

 

<F7>

Move to the end of the data on a line

 

<PG UP>

Move cursor up a screen

 

<PG DN>

Move cursor down a screen

 

<HOME>

Move cursor to top of screen, then to first screen

 

<Left Arrow>

Move the cursor left one space

 

<Right Arrow>

Move the cursor right one space

 

<Up Arrow>

Move the cursor up one line

 

<Down Arrow>

Move the cursor down one line

 

<TAB>

Move cursor right 8 characters

 

<SHIFT> <TAB>

Move cursor left 8 characters

 

<CTRL> <END>

Delete the rest of the line

 

<ALT><F9>

Toggle Insert/Overtype mode.

 

<BACK SPACE>

Move cursor one space to the left

Table 2-1. Standard DOS Editing Keys

 

NOTE: For UNIX/XENIX systems see the filePro Plus Terminal Guide in the fPmanual.

6. The cursor is at the beginning of field number 1. Try using the arrow keys to move the cursor down and to the right. Press <HOME>. The cursor will return to its original position. Now you’re going to type in the field name for field number "1" in the “cust” file. In general, field names should be short but descriptive e.g. “last name, “zip code", etc. filePro Plus can automatically create a default screen using the field names you enter. The default screen is always identified as screen zero (0).

7. We want to create a field named “customer number”, so enter the "customer number" in the field heading area. Press <RETURN>.

8. Pressing <RETURN> moved the cursor to the “Len” (field length) for this field This is where you decide how many characters of data you want to keep in the field. For this exercise enter "4" and press <RETURN>.

9. With the cursor in the next column labeled “type” (for data type or “edit”), press <RETURN>. Leaving the field type blank tells filePro Plus to allow any characters to be entered into this field.

10. Move the cursor to the next line (field 2) and type "name last". Press <RETURN>.

11. For the length, enter "10". Press <RETURN>.

12. Skip the “Type” field type for now by pressing <RETURN>.

13. Fill in the information for field 3, “name first” with a length of 10 and check all three fields against the completed screen (Figure 2-6).

 

image\fig2-6.gif
Figure 2-6

14. Note the commands displayed at the bottom of your screen. Press <F10> for Help and a Help screen appears. Turn the NUM LOCK key off. Then use the <PgUp> and <PgDn> keys to see additional Help screens. Almost all of the filePro Plus modules provide Help and the key to press is always <F10> (DOS) or <Ctrl><Z> (UNIX). When you are finished looking at the help screens, press <X> or <RETURN> to return to the Define Files Screen.

15. When you have finished filling in the Define Files screen, check the “Characters Used:” (displayed at the bottom of your screen); this shows you the total number of characters for all the fields in the file. It should display “24”. If a different value is displayed, go back and correct the field lengths. Then press <ESC> to save the file structure.

16. Notice that the commands at the bottom of the screen have changed. Press “X” to exit.

17. The commands have disappeared and have been replaced by a question “Create a screen 0 (Y/N):”. “Screen 0” (the default data-entry screen) is available for data entry without any additional work on your part.

Press <Y>. You will see a brief message: “Writing Screen 0”.

18. The next question asks you if you want filePro Plus to create a default report. A default report is immediately available without any formatting on your part. It prints out all the records in the file, with all the information in field number order. Press <Y>. You will see a brief message: “Writing default report”.

19. The third question gives you the opportunity to create automatic indexes for your file. Remember that indexes are used as a high-speed method of accessing data within a file and for joining multiple files in a database or application. Press <Y>.

20. The forth prompt asks if you want filePro Plus to create qualified files: “Create qualifiers (Y/N):”. This feature is used when a single database structure is to serve several separate entities: companies, branches, divisions, etc. You create and maintain one database structure, but each entity’s data is kept separate. A “qualified” file is identical in structure to the one you define. Press <N> or <RETURN>. If you respond “Yes” to the prompt, all you have to do is give the qualified file a name and it is created for you automatically.

The data that is entered into a qualified file is always kept separate from the original file and from other qualified files (you can create up to 160 qualified files from one original file). Qualified files are accessible from the operating system command line, or from a user menu; filePro Plus does not display qualified file names in the file name selection window.

21. Press <ESC> to save the customer file definition and filePro will take you back to the "Define files" screen. We will create an index on “last name” and “customer number”. So when filePro Plus asks what field that index “A” should be built on. Press <2> (the “last name” field) and press <RETURN>.

22. filePro Plus now asks what field index “B” should be built on. Press <1> (for the “customer number” field) and press <RETURN>.

23. filePro Plus now asks about index “C”. At this prompt just press <RETURN> for no index. filePro Plus will let you build as many as 16 automatic indexes for your file (A - P).

You should now be back at the filePro Plus main menu.