9 Update Files

This chapter contains these topics:

9.1 About Updating Files

With World Writer you can update a field in a file with either user-defined values or with values from another field within the file. Multiple fields can be updated at one time.

9.1.1 Before You Begin

  • JD Edwards World recommends that you back up the file that you are updating.

Caution:

It is easy to update fields with World Writer, but it may not be easy to undo the changes if an error is made. Use the steps in the following sections to verify the records that will be updated with the new value of the field.
  • Read through the entire chapter, so that you are familiar with the update process.

  • Practice the update procedure in a test environment before impacting your production data.

9.2 Creating World Writer Versions

This section describes the following steps to update a field:

  • To create a World Writer Version

  • To apply group level security

  • To apply field level security

  • To select the update mode

  • To verify the updated records

  • To update multiple fields at one time

To create a World Writer version

Only one file can be specified on Version Title and Files. The update function cannot be performed if more that one file is entered or if the file is a joined logical file.

On Output Field Specifications, select fields that will help to identify the records that will be updated. This is for your benefit and for an audit trail. For instance, if F0911 is the file to be updated, you might want to choose the Document Number, Document Type, GL Date, and Batch Number.

You will also include the field to be updated, known as the TARGET or TO field. You need a field that holds the value to be moved into the target field. This is known as the SOURCE or FROM field. The SOURCE field can be either an existing field in the file or a calculated field. In either case the SOURCE field should have the same attributes as the TARGET field, i.e., alpha or numeric, size, decimal places. Both the TARGET and SOURCE fields must be printing fields.

  1. On Data Selection, enter the criteria to select only the records to be updated.

    You do not need to set up any Data Sort & Totaling or Summary Functions. If you want to do some sorting, the only rule is that you cannot sort on the field being updated.

  2. Verify the data to be updated.

  3. Submit the version and verify the data appearing on the report are the records to be updated.

    The version is just a report at this stage; we have not put it in update mode. All of the records you see on the report are the ones that will be updated.

  4. Verify that the value in the SOURCE or FROM field is the value to be placed in the TARGET or TO field.

To apply group level security

Navigation

From World Writer (G82), enter 27

From World Writer Advanced Operations (G8231), choose Query Group Level Security

World Writer does not automatically allow a version to be run in the update mode. Security must be set up by user to allow this access.

On Query Group Level Security

Figure 9-1 Query Group Level Security screen

Description of Figure 9-1 follows
Description of "Figure 9-1 Query Group Level Security screen"

  1. Inquire on the User ID that will be submitting the World Writer version for file update.

  2. If the User ID highlights, add the user and type the Group ID from the World Writer Version in the subfile portion of the screen.

  3. In the Fupd column, enter Y to allow update access, and press Enter.

  4. Inquire on the User ID to ensure the record was added.

  5. If the User ID already exists, change the record accordingly.

To apply field level security

Navigation

From World Writer (G82), enter 27

From World Writer Advanced Operations (G8231), choose Field Level Security

On Field Level Security

Figure 9-2 Field Level Security screen

Description of Figure 9-2 follows
Description of "Figure 9-2 Field Level Security screen"

  1. Inquire on the User ID that will be submitting the World Writer version for file update.

  2. If the User ID is highlighted, complete the following fields:

    • User ID

    • File ID

  3. If the User ID already exists, change the record to include the file for update.

  4. If the file already appears in the list, enter Option 1 next to the file to review the field for update.

  5. Press Enter. All the fields from the file ID you entered will display.

  6. Find the field to be updated and enter Y in the Upd column. You can also type the Field Name on a blank line.

  7. Press Enter.

  8. Inquire on the User ID and File ID to ensure the record has been added.

  9. If the User ID and File ID exist, choose F16 to include the field for update.

Figure 9-3 File/Field Level Security screen

Description of Figure 9-3 follows
Description of "Figure 9-3 File/Field Level Security screen"

To select the update mode

On Output Field Specifications

Figure 9-4 Output Field Specifications screen

Description of Figure 9-4 follows
Description of "Figure 9-4 Output Field Specifications screen"

  1. Enter Option 7 next to the field you want to update (TARGET).

  2. On the Query File Update Spec screen, update the To Field Name field.

    Figure 9-5 Query File Update Spec window

    Description of Figure 9-5 follows
    Description of "Figure 9-5 Query File Update Spec window"

  3. Enter the SOURCE field name in the From Field Name field. This is either the calculated field or and existing file field that contains the value to be moved to the TARGET field.

    The system places the version in update mode. The update will take place when you submit it. Submitting the version generates a report, however it will give no indication that the update took place. World Writer writes the record as it currently exists in the file, then runs the field update.

  4. To take the version out of update mode, enter Option 7 next to the TARGET field and remove the SOURCE field name.

Note:

It is good practice to take the version out of update mode so that it doesn't get submitted accidentally.

To verify the updated records

Verify that the update took place in any one of the following ways:

  1. Take the version out of update mode and submit it. The report generated should now show the new value in the TARGET field.

  2. Check a sampling of the records online.

  3. Review the file directly using RUNQRY or another utility that displays the records in a database file.

To update multiple fields at one time

  1. Create the World Writer version and submit to verify the results are as expected.

  2. Set up Group Level and File Level security for all the fields to be updated.

  3. From Output Field Specifications, choose F18 to access the Query File Update Specs screen, V82117.

    This screen allows you to enter multiple TARGET and SOURCE field names at one time. Using this screen takes the place of using Option 7 and puts the version in update mode.

  4. Submit the version in update mode, and then verify that the records were updated.

  5. To take the version out of update mode, access V82117 again and enter Option 9 to delete the fields.

Figure 9-6 Query File Update Specs screen

Description of Figure 9-6 follows
Description of "Figure 9-6 Query File Update Specs screen"

9.2.1 Key Update Tips

  • You can perform data file updates only on single files. Reports that have joined files or that used joined logical files will not allow the update function.

  • Always run the version first before putting in the update mode. This ensures that the correct data is selected for the update.

  • You cannot sort by a field that is being updated.

  • You cannot include a presumptive join for a field that is being updated.

  • You cannot include the field that is being updated more than once on Output Field Specifications.

  • Target is the field that is being updated.

  • Source is the field that the update is coming from.

  • Both Target and Source must be printed fields.

9.2.2 What You Should Know About

Topic Description
Updating Julian date fields The value must be entered in the Julian format, for example 103131 for May 11, 2003. See Appendix C, "Julian Date Conversion Charts" for a Julian calendar conversion chart.
Updating an alphanumeric field to Blank Enter two single quotes ('') as the expression.

You do not need a space between the quotes.

Updating a numeric field to Blank Enter a zero (0) as the expression. If the field to be updated has decimal places, enter the expression as 0.00 with the correct number of decimal places shown.
Error 2929 - 'Join files cannot use file update' when putting option 7 next to a field to be updated You cannot use World Writer for a field update if the version has more that 1 file that it has written over. You cannot use a joined logical file and perform a field update.
Error 1778 - ' Field must be selected for query output ' when typing a field name in the From Field Name field on the Update Spec window The field entered must be defined as a printing field on Output Field Specifications.
Error 1761 - ' End of expression expected, not found ' when typing a field name in the From Field Name field on the Update Spec window An attempt is being made to update an alphanumeric field with a numeric value or vice versa. Check either the expression on your calculated field or the field attributes if you are using a field within the file for the SOURCE field.
Error 1737 - ' Not authorized to version ' when attempting to run the version in update mode Press F18 on the Output Field Specification screen. The field(s) under the To Field column includes fields used for updating and must be in Field Level Security. If you have copied a version that also performed an update, you may have copied the Update Specs as well. Delete the field(s) that are not going to be updated using Option 9.
No field update even when the version runs successfully (no job log) in update mode Check to see if you have a presumptive join field for the field you have updating. A presumptive join field will have the same field name with a numeric extension. For example, GLMCU is the field you are updating. If you have GLMCU01 on the Output Field Specifications screen, the update will not take pace. Delete the presumptive join field and submit the version again.

Also, if the field you are updating appears more than once on Output Field Specifications, the update will not take place. Delete all but one occurrence of the update field.

Updating non-JD Edwards World files The file must be in your library list before Field Level Security can be set up.
The results of the calculated field look as expected on the report. However when verifying the updated records, the new value in the field contains the wrong data. One reason this may occur is how the field being updated is defined in Data Dictionary. The Data File Decimal field describes the decimal places actually stored in the field. This is normally 00 (zeros). The Display Decimals field contains a number of decimals that this field will display on videos and reports.

There are some exceptions; one being when the value in the Data File Decimals field is greater than 0 and the Display Decimals field is blank.

To successfully update these types of numeric fields, change the Prt Dec field on the Output Field Specifications screen to 0 for both the field to be updated and the calculated field. The expression of the calculation should contain the correct number of decimal places.

In the example below, the CRR field is defined in Data Dictionary with 7 in the Data File Decimals and the Display Decimals is blank. In order for this field to be updated correctly, change the 7 to 0 on Output Field Specifications - Prt Dec column. The calculated field, NEWCRR, is also set to 0 in Prt Dec column and the expression contains the decimal places desired. When this version is submitted, the TDCRR field would be correctly updated with a value of 23.8500000. However the report will look incorrect because without decimal places, the value is rounded. In the example, the value on the report would be 24.


Figure 9-7 Output Field Specifications screen

Description of Figure 9-7 follows
Description of "Figure 9-7 Output Field Specifications screen"