8 Handling Data


1

2

3

4

5

1. Unit Objectives

In this unit we will set record and field attributes to the sample date file and create a Data Format file that will store those definitions. In order to link the data aliases used in the Response Letter to the sample data, we will create a data map.

2. Record Attributes

Start of Publication

The start of a new publication data set within the input data is indicated by the presence of a specific data element known as a start of publication record. In the production environment the presence of such records tells Series 5 to expect a new publication data set and to reload the appropriate logic. At least one element within a data format must be assigned this flag.

Mandatory records

By default, records other than those flagged as Start of Publication do not have to appear in every publication data set. Provided if fields within the record are used conditionally within document designs, they will simply be ignored when they are not present. However, it may be important to your document design to make sure that certain records are always present before attempting to process a publication.

Where this is the case you can flag such records as being Mandatory. If a mandatory record does not appear in a publication data set where it was expected, DOC1 Generate will abort.

Single Repeating records

If this format option is selected, this tells Series 5 that the record may repeat zero or more times.

  • A record can be defined as both Single Repeating and Mandatory, meaning it will always occur at least once, but maybe more times.

3. Formatting Sample Data - Defining Records

You should now be presented with the window below. Notice how all the fields are colored red. This means nothing has been defined. We will begin by identifying our records and then we will define our fields.

In this section we will set the position of our key records.

  1. 1. In the first column, highlight C001.

  1. 2. From the main menu select Define/ Key.
  1. 3. Confirm From 1, To 4, and Length 4.
  2. 4. Click Define.

so far:

With the key record positions defined, the next thing is to identify the attributes of each distinct record. We are going to start by identifying record C001 as the Start of Publication. This signifies that Series 5 will begin a new output document every time it sees a C001 record.

  1. 5. In the structure view, right-click “C001” Untitled.
  2. 6. Click, Start of Publication.
  1. 7. In the structure view, right-click “C001” Untitled.
  2. 8. Click Rename.
  3. 9. Type, C001- Customer Information

Continue with the C002 record by setting it to Mandatory. We are telling Series 5 that these records need to be in every data document.

  1. 1. In the structure view, right-click “C002” Untitled.
  2. 2. Click, Mandatory.
  3. 3. In the structure view, right-click “C002” Untitled.
  4. 4. Click Rename.
  5. 5. Type, C002- Customer Details.

so far:

4. Formatting Sample Data - Defining Fields

Next we will continue by defining the fields for each record.

  1. 1. In the first row, highlight bytes 6-19.
  1. 2. From the main menu select Define/ Field.
  1. 3. Description, type, C001- Customer Name.
  2. 4. Type, select, String.
  3. 5. Click Define.

so far:

  1. 6. Using the table below to define the rest of the fields:

Record C001 Customer Details

Description

From

To

Length

Type

C001- Address Line 1

21

39

19

String

C001- Address Line 2

41

59

19

String

C001- City

61

79

19

String

C001- Post Code

81

88

8

String

Record C002 Account Details

Description

From

To

Length

Type

C002- Account Status

6

19

14

String

C002- Account Number

 

21

39

19

String

C002- Service 1

41

44

4

Number

C002- Service 2

46

49

4

Number

C002- Service 3

51

54

4

Number

so far:

The data layout looks like:

  1. 7. From the Standard toolbar click, the Save Draft icon.

5. Creating a Data Map

When you are designing publications you work with data aliaes to the records and fields that will be supplied by the input data file in the production environment. The actual data elements are defined in a data format file which uses a sample of the intended input data as a template. Before publishing, the data aliases within a publication, must be linked to the relevant elements in a data format using a data map object.

Once the data has been defined, we can continue by mapping the correct data fields in our definition to the data names in our data dictionary. Before doing that we must Issue it. By Issuing you mark the file currently active within the repository and make it available for use with a publication when it is published.

  1. 1. In the Work Center Manager click on Data tab, Data Format bar.
  2. 2. Double-click the Company Letters project folder.
  3. 3. Highlight, ResponseSample Data Format.
  4. 4. From the main menu select Task/ Issue.
  5. The data format is now available to the data mapping software.

In this section we will create a data map.

  1. 1. In the Work Center Manager click on Data Maps bar.
  2. 2. Double-click the Company Letters project folder.
  3. 3. From the main menu select File/ New Data Map.
  4. 4. Rename the new data map ResponseLetter.
  5. 5. Press Enter.
  6. 6. On the far right hand side click
  7. .

This will open up all the Data Format files.

  1. 7. Click the Company Letters project folder.
  2. 8. Click ResponseSample Data Format.
  3. 9. Click Open.

You will be presented with the Data Map Editor. Next we will match our data with our data dictionary we created earlier. Notice how the Publication Data Set and Data Set sections are populated.

  1. 1. Click the Add Field button
  2. .
  1. 2. Select Customer Name.
  2. 3. Click OK.
  3. The alias now appears in the Data Fields list.

In this section we will map the datafields to the data set.

 
  1. 1. In the Data Field list, click Customer Name.

  1. 2. In the Data Set list under C001Customer Information, click C001 Customer Name.

  1. 3. Click the check mark button
  2. .
  • If the mapping was successful, a check will appear beneath the data alias icon.
  1. 4. Repeat the same process for the following:
  2. Data Fields

    Data Set

    Account Status

    C002- Account Status

All the data fields should have check marks next to them. This completes the mapping of the data aliases to the actual data sets.

By Issuing you mark the file currently active within the repository and make it available for use with a publication when it is published.

  1. 1. Click the Save Draft icon.
  2. 2. Highlight, ResponseLetter data map.
  3. 3. From the main menu select Task/ Issue.