Tutorials

File Maintenance

Last Revised: 02/25/14

One of the most popular applications is to provide File Maintenance or the ability to add, modify, and delete records from a data file.  Dynamo Tools includes routines that can provide fully functional File Maintenance with little or no coding.  The File Maintenance application is driven by the Data Dictionary, so it is easy to create and modify these applications.  There are several places where File Maintenance applications can call your custom routine that might be needed to perform special processing.

Let's start with some screen shots and a video of several File Maintenance applications that are included with Dynamo Tools.

File Types

Dynamo Tools File Maintenance application can use any of the keyed data file types.  The preferred file type is MKY or MKX, MKJ, MKV when using bbj.  Traditional Direct (DIR) and Single keyed files (SKY, SKX ,SKJ, SKV) where the key is not contained within the data is supported, but not recommended.  Sort files (SRT) and other files with zero characters per record are not supported.

Field Types

Dynamo Tools File Maintenance supports all of the field types supported by the data entry routine CDS039 except for Notepad/Window text.  However, Notepad Window Text can be maintained by providing a very small external program.  See example.

Field Types
String Variable or Fixed length strings for names, etc.
Masked Numeric A number typically displayed with a mask such as ###, ##0, 000, -#,###.00, etc.
Unmasked Numeric A number that may or may not have a fractional part such as 123, 12.3, 123.45, 123.456, etc.
Date File Maintenance dates are always displayed and entered using MM/DD/YY format, although they may be stored in any of the formats:
FormatTemplate option
BBx Julian (preferred)N(7) or U(3)
MM/DD/YYC(8)
YYMMDDC(6) or N(6)
Microsoft JulianC(5) or N(5)
Custom When additional processing is required, you can use a Dynamo Tool external routine, or write one yourself.
External Routine TypeExampleDescription
T (preferred)CDX100Provides complete record being maintained in a single string Template
X (obsolete, but still supported)CDX040Provides a single string variable used by the external program to display and maintain on one or more display lines
C (obsolete, but still supported)CDX030Provides a single string variable used by the external program for entry only on a single display line

Getting Started

Here is a very simple example where a three character salesperson number has a 30 character name.

  1. Create the Data Dictionary
  2. Create a View
  3. Create a File Maintenance Configuration
  4. Define the Data File
  5. Add application to the Menu
  6. Test application

Step 1: Create the Data Dictionary

Use Data Dictionary Maintenance (FMS) as shown in the screen shots below.

If you want to build this application for yourself, it is recommended that you do not use company code CD, as that is reserved for Dynamo Tools, and the CD Data Dictionary is replaced during a Dynamo Tools upgrade.  I used company code DS in this example.  You can create a new Dynamo Tools 'Company' using Company Maintenance which is located on the SMU menu.

Field Note
Data Dictionary Name Although the Data Dictionary Name can be up to 10 characters, the best practice is to use a 4 character Data Dictionary Name.
File Type Any supported file type can be used, however MKY or any of the MKx bbj file types are recommended.
Path The default data file name will be (SMSDIR)/DS/DSEX01. The current company code is DS.
Menu Code Before creating this Data Dictionary add a menu code such as EXA to your company where the resultant File Maintenance application can be executed.  Use Menu Maintenance on SMU Menu to maintain the Dynamo Tools Menu.
Key Size The Key Structure for MKx files is defined after defining the Fields.
Record Size The Best Practice is to use no field separators between fields.  If you do that, then you do not need to make an entry in the Record Size field.

Field Note
Description This is the text that will display on the left side of the view during File Maintenance.  If not specified the Column Title or Field Name will be used, so try to enter a Description that is understandable for the user running the File Maintenance Application.
Data Entry Type Key segments should not be variable length.  In this case we selected a right justified entry.  This is useful when the entry might contain numbers with a variable number of digits such as 1, 10, and 100 so that the records sort in logical order.  Use a left justified field for most non-numeric entries with a variable number of characters.
Minimum This refers to the minimum number of characters required for the entry.  Enter 1 to prevent an all blank entry.  The 1 indicates that at least 1 non-blank character is required.
Maximum The Best Practice is to leave this entry blank in which case the Maximum is derived from the Template field size (3 in this example). 

Step 2: Creating the View

The next step in the process, is to define what is called a Standard View.  A Standard View is simply an ordered collection of fields contained within a record.  File Maintenance Applications require at least one Standard View.  The View Option, now located within Data Dictionary Maintenance, is used to maintain all views.  The View should only include the fields to be maintained, not the key segments used to identify the record.

Step 3: Creating File Maintenance

Use the File Maintenance Option, now part of Data Dictionary Maintenance, to maintain a File Maintenance Application.  Refer to the documentation for the field definitions, and create a File Maintenance as shown below.

Step 4: Define the Data File

You can use the 'Define/Convert Data File' option of Data Dictionary Maintenance, or the File Utility (SMU) to define the data file.

 

Step 5: Add the Application to the Menu

Attach the new File Maintenance application to the menu using Menu Maintenance (SMU).

Field Note
Description This is the text that will appear on the menu.  Make it something the end user can understand.
Type F inidcates this is a File Maintenance application.
Program/File Enter the Data Dictionary company code and name, XX can be used to reference the current company.  Note that this field is limited to 6 characters, but you can write a small program to CALL "CDS028" for longer data dictionary names.
VDT Suffix The VDT Suffix, typically A, that was specified using File Maintenance Configuration.

Step 6: Test the Application