37 Work with Crossover Rules

This chapter contains these topics:

37.1 Working with the Crossover Rules Screen

The Crossover Rules screen lets you add, change, and delete crossover rules used in the Universal File Converter process. Use this form to set up or maintain associations between fields in the From file and the To file. You need only map the fields that you are concerned with.

Note:

There are many conversion rules in UFC to cover most situations, try them first before using custom Xxxxx programs.

Lines with **FILLER in either the from file or the to files are ignored enabling you to view From file fields with no corresponding To file fields or view To file fields with no corresponding From file fields.

To work with the Crossover Rules form

  1. From the Universal File converter menu, choose Crossover Rules.

    Figure 37-1 Crossover Rules screen

    Description of Figure 37-1 follows
    Description of "Figure 37-1 Crossover Rules screen"

    The form above displays illustrative data only. This is where the mapping details are entered. The From file fields appear on the left. The To file fields display on the right.

  2. Complete the Crossover Rules form.

    • F8 and F9 are toggles. Press them to suppress or activate the display of the **FILLER fields in the From and To files.

    • Use F6 to pull up full information about both fields on the Crossover Rules screen. See Section 37.3, "Adding Fields"

    • F14 is cursor-sensitive. If you are on a From file field, press F14 to enter text for that field. When the cursor is on a To file field name, press F14 and the Generic Text Form opens for that To file field name. You can also enter text for the From file and To file by placing the cursor on the appropriate field. The field name is highlighted on V0031 if generic text exists. For additional information refer to the JD Edwards World Computer Aided Software Engineering Guide.

    • Press F4 to display detail information in the detail area.

Field Explanation
Form Id This will always be P00120, the Version Setup program.
From File Name The file that data is being transferred "from" in the file conversion process.
Version This is the version name you created and ran in the Setup step.
To File Name The file that data is being transferred "to" in the file conversion process.
Skip to… Enter either the FROM field name or the TO field name to skip to in the subfile.
From File …. Heading for the fields that data is being transferred "from" in the file conversion process.
To File …. Heading for the fields that data is being transferred "to" in the file conversion process.

Figure 37-2 Completed Crossover Rules screen

Description of Figure 37-2 follows
Description of "Figure 37-2 Completed Crossover Rules screen"

Field Explanation
From File Field name The name of the field in the FROM file for source data that is used in the conversion process.
From File Field Data Type The type of data of the field in the "from" file. The data item types are defined in User Defined Codes, system code '98', record type 'DT'. (F1) Usually A for fields in a PC (ASCII) file.
From File Field Begin Pos The beginning position of the field in the "from" file.
From File Field Size In Bytes The number of bytes for the field in the "from" file.
From File Field Number of Digits The actual number of digits in the "from" file field. In a non-packed field this is the same as the number of bytes. Numeric fields)
From File Field Decimal Positions The number of decimal positions in the "from" file field. (Numeric fields)
From File Field Description The description of the "from" file field. If the file is declared a JD Edwards World file, this will be the first part of the Data Dictionary description.
REF (Reference) Use reference field for those conversion rule entries that refer to the Data Dictionary.

Figure 37-3 Completed Crossover Rules screen

Description of Figure 37-3 follows
Description of "Figure 37-3 Completed Crossover Rules screen"

The left side of the form contains information about the From file.

The right side of the form contains information about the To file fields. If the setup program made associations with the To file fields, they display in the right columns when you inquire on a Form ID. Otherwise, these columns contain **FILLER information.

37.1.1 What You Should Know About

You should be aware of the following rules when you work with crossover rules.

Topic Description
To review a specific set of crossover rules Enter the DREAM Writer version you used to create the rules.
To update information on Crossover Rules form Enter the To file field, type, beginning position, number of bytes, and number of digits and decimals, if applicable. Required information is name, type, beginning position and number of bytes.
"Skip to" capabilities Two "skip to" capabilities are available on this form. You can skip to a field in either the From file or the To file.
*DFT When using *DFT if the literal is over 6 positions then part it out as if dealing with two fields.
Packed numeric Packed numeric values use ½ their length plus one in a file. A numeric field defined as a length of 15 only uses 8 bytes.

Negative, or signed fields, must have the 'sign' character in the FROM file.

In the Crossover Rules, when using a User Defined Code Lookup keyword (*UDCssssrr) and the system code is only 2 numbers, such as 55, enter it as __55 (with leading blanks), not 0055 or 5500.

Negative, or signed fields Negative, or signed fields, must have the 'sign' character in the FROM file.
Using lookup keyword *UDCssssrr In the Crossover Rules, when using a User Defined Code Lookup keyword (*UDCssssrr) and the system code is only 2 numbers, such as 55, enter it as __55 (with leading blanks), not 0055 or 5500.

37.2 Displaying Field Descriptions

To display field descriptions

  1. Press F13 in the Field Name column for the From or To file.

    The File Field Descriptions form displays, as shown below.

    Figure 37-4 File Field Descriptions screen

    Description of Figure 37-4 follows
    Description of "Figure 37-4 File Field Descriptions screen"

    • When you use option 4 to select a field from the form, the program returns the name, type, number of bytes, number of decimals, number of digits, description, reference, and key position to the appropriate fields on the form. For Crossovers on the File Field Descriptions window, refer to the JD Edwards World Computer Aided Software Engineering Guide.

    • For details on the Data Dictionary Repository form, the Glossary form, and the Cross Reference options on the File Field Description form, refer to the Technical Foundations Manual.

  2. Enter 4 in the option field. The program returns the field description to the associated field as shown in this example.

Figure 37-5 Crossover Rules screen (with Field Description in Associated Field)

Description of Figure 37-5 follows
Description of "Figure 37-5 Crossover Rules screen (with Field Description in Associated Field)"

37.3 Adding Fields

To add a field

  1. Press F6 to open the Add Crossover Instructions form.

    Figure 37-6 Add Crossover Instructions screen

    Description of Figure 37-6 follows
    Description of "Figure 37-6 Add Crossover Instructions screen"

    This window presents most of the fields on the Crossover Rules screen.

  2. With the cursor in the Field Name field on the Crossover Rules screen, press F13 to open the File Field Descriptions form.

  3. Select a filed using the 4 option.

  4. Press Enter.

    The program returns the field information to the Field Name when you exit the form.

    The required fields for adding a field are:

    • From field name, type, number of bytes, and beginning position

    • To field name, type, number of bytes, and beginning position

    The add function is available to associate a single field in the From file with multiple fields in the To file and to break apart a From field into multiple fields.

    A field can exist in the To file and have nothing associated with it in the From file. In this case, the To file field is initialized as described in the section "Special Processing".

37.4 Deleting Records

To delete a record

Choose option 9 to delete records from the Crossover Rules file.

This cancels the From -To relationship so that no conversion takes place.

If you blank out the To file field name, the program does not delete the record from the Crossover Rules file, but only clears the To file field information. The converter program looks only at records that have both a From and To file field name.

Note:

You do not need to delete lines with blank (**FILLER) To file field names, they are automatically skipped in the conversion process.

37.5 Keywords

Keywords in the Conversion Rule field (in the fold area) trigger special processing for a field before the data is transferred. Following are the keywords that are available and a brief explanation of what processing they trigger.

Caution:

With the exception of the date keywords listed below, specify conversion rules for either From field or To field, never for both.
Keyword Description
Dates - *MDY, *DMY, *YMD, *JUL, *SYSVAL These keywords activate a date conversion between the From file field and the To file field. You must type keywords into both the From file Conversion Rule field and the To file Conversion Rule field. Each keyword on the From field specifies how the field is stored in the From file. The keyword on the To field conveys the output format on the To field.

Note: This does not work on packed fields.

Business Unit - *RAB. This keyword activates the business unit scrub of right adjust and blank fill to the From file field before moving it to the To field.
Initialize - *ZEROES, *BLANKS These keywords move either zeroes or blanks to the From file field before it is transferred. With the initialization rules, these keywords are not required unless you want to initialize an alphanumeric field to zeroes.
Data Dictionary Default - *DEF This keyword retrieves the Data Dictionary default for the To file field, using the Reference field in the Data Dictionary, and loads it to the From file field before it is transferred.
User Defined Code - *UDCsssrr This keyword retrieves the definition of the user defined code used in a specific system and loads it to the To field. When typing your request, ssss is the system and rr is the user defined code.
Default Constant - *DFTcccccc This keyword loads a default constant to the To field. When typing your request, cccccc is the default constant.
Next Number - *NNssssxx. This keyword computes a next number and loads it to the To field. When typing your request, ssss is the system and xx is the bucket number.
Check Data Dictionary - *CHK. This keyword lets you edit a field against Data Dictionary values and ranges. The results of the edit print on the File Conversion report whenever any errors are detected.

37.6 About the Conversion Rule Program

Besides specifying the use of keywords in the conversion rule, you can specify an external program that runs before the data is transferred to the To file field. You must name the external program beginning with an X. For example, use an "X" program to determine a range of valid values in a From file field, excluding records based on a given field. Other examples include writing multiple To file records based on a single From file record, or manipulating the data before it is transferred.

The external program requires five parameters:

PARM Description
First parameter Must be 50 bytes and contains the value of the field being processed. Use it to send the value to the converter program and receive the value when the "X" program is done with it.
Second parameter One-byte error flag. If the error flag returns blank, the data in parameter 1 from the "X" program is placed in the To file.
  • If the error flag returns with 2, the data in parameter 1 is not transferred to the To file. Use this error if you are writing multiple To file records and different From file fields are used for a single field in the To file.

  • If the error flag returns with 3, a record will not be written to the To file. Use this error if you do not want to write a record when the value of a certain field in parameter 1 is blank, zero, or not valid for your purposes.

Third parameter Four-byte alphanumeric field for the number of the To file records. The field always has numeric characters and is zero-filled. This lets your "X" program know which record the converter program will write when you are writing multiple To file records.
Fourth parameter Ten-byte field for the From file field name. This lets your "X" program know which field you are processing if multiple fields in the From file are updating a single To file field.
Fifth parameter Ten-byte field for the To file field name. This lets your "X" program know which field you are processing if multiple fields in the From file are updating a single To file field.

37.7 Available Functions and Options

Function Description
F6 Add Instructions

To add fields to be converted, press F6 to access the Add Cross Over Instructions Form. The required fields for adding a field are Field Name, Field Data Type, Field Beginning Position, and Number of Bytes.


Figure 37-7 Crossover Rules screen

Description of Figure 37-7 follows
Description of "Figure 37-7 Crossover Rules screen"

Function Description
F8 Suppress From **FILLER Fields

Will not display those lines with **FILLER values in the From field.

F9 Suppress To **FILLER Fields

Will not display those lines with **FILLER values in the To field.

F13 File Field Description

Place cursor on any Field Name field and press F13 to display the File Field Description form.

F14 User Defined Text

Highlight to indicate that there is generic text associated with this field.

  • Press F14 in the top area of the form to enter text about the conversion.

  • Press F14 in the From Field area (left side of the form) to enter text describing the From Field.

  • Press F14 in the To Field area (right side of the form) to obtain text describing the To Field.

The field will highlight to indicate that there is generic text associated with this field.


Option 9 - Delete Records

To delete records so that no conversion takes place, enter Option 9. If you blank out the To File Field Name, the program does not delete the record from the Cross Over Rules file (F0031), but only clears the To File Field information. The converter program will only look at records that have both a from and to file field name.