45 Purge Data

This chapter contains these topics:

Navigation

From ECS Sales Order Management (G4910), enter 27

From ECS Sales Order Advanced and Technical Ops (G491031), choose Data File Purges

From Data File Purges (G42312), choose an option

45.1 Purging Data for ECS Sales Order Management

When data becomes obsolete or you need more disk space, you can use purge programs to remove data from files.

Purging data consists of:

  • Specifying the information to delete

  • Running the purge program

  • Running the file reorganization program to rebuild the file structure

Caution:

You must know the proper procedures and consequences of purging data to avoid serious damage to your system and data. Purging data is typically performed by a system administrator or operations personnel. It is important that only those employees who understand the purging process and its results are allowed access to this procedure.

You can run two types of purges:

  • Run general purges

  • Run special purges

General purges are DREAM Writer versions of the JD Edwards World general purge program that removes data from a specified file. You run these purges when you want to remove a large amount of data.

JD Edwards World provides special purges for removing data from files where the selection criteria needs to be more specific. Special purges are DREAM Writer programs that have predefined criteria that the system checks before removing any data so you avoid removing associated data located in other files.

You run these general and special purge programs in the ECS Sales Order Management system only if you want to manually purge the associated tables. You can instruct the system to automatically purge most of these tables during end of day processing. You can set the processing options for the Update Customer Sales program to automatically purge the following tables:

  • Sales Order Header (F4201)

  • Sales Order Detail (F4211)

  • Sales Order Detail - Tag History (F49219)

  • Text Detail Lines (F4314)

  • Price Adjustment History (F4074)

45.1.1 What You Should Know About

Topic Description
Customer Service Inquiry (P42045) To minimize the size of the Sales Order files, the concept of 'purging to history' may be implemented by either the Sales Update program (P42800) or by running Special purge programs. During this process, completed sales orders from the Sales Order Header and Detail files (F4201 and F4211) are moved to their respective history files (F42019 and F42119). The Customer Service Inquiry program reads both sets of files enabling both active and historical sales orders to be viewed in a single program.
Customizing a purge You can create a customized purge by changing the data selection to fit your needs. For example, you could use a range of fiscal years rather than all dates.
Processing options All of the DREAM Writer versions of the P00PURGE program and many of the Special Purge programs have the following two processing options:
  • Save Purged Records - This determines whether deleted records are copied to an archive file in a designated purge library. JD Edwards World strongly recommends that this option always be set to 1 so that there is an opportunity to recover the deleted records.

  • Reorganize File - This tells the purge program whether to reorganize the physical file that has just been purged. Since the space occupied by deleted records is not recovered until the file is reorganized, you can choose to let the purge program do the job or run the IBM command (RGZPFM) manually at a later date.

Technical considerations The following technical considerations apply to both general and special purges:
  • If File Output Type on the DREAM Writer Additional Parameters form for the DREAM Writer version you are using is set to 1 (for OPNQRYF), you must also set the Open for Delete (Y/N) field to Y. Also, you must specify at least one field in Data Sequencing.

  • If File Output Type on the DREAM Writer Additional Parameters form for the DREAM Writer version you are using is set to 2 (for logical file), the purge will reorganize the purged file based on the logical file that the system builds. This might increase the time that the system takes to perform the file reorganization.

Restoring purged records If you have used the save purged records option you may in very exceptional circumstances restore purged data. Prior to copying the purged records back in to your data files ensure you have created a copy or backup of the specific data files.

The purge library created by the purge program will have been named by the following convention: JD Edwards World followed by the purge date in MMDDYY format (e.g. for a purge run on April 15, 2017 would create a library named JDE041517.

To identify purge libraries on your system, use the work library (WRKLIB) command with 'JD Edwards World*' as the library parameter. The Text Description for the library will also inform you whether the library was created to contain purged data.

To copy the purged records back use the copy file (CPYF) command specifying '*ADD' in the 'Replace or add records' parameter.

Note: File restore operations should only be performed by experienced technical staff.


45.1.2 Before You Begin

  • Back up the files that will be affected

  • Determine the data you want to purge

  • Verify that no users are working with the data that you want to purge and reorganize

45.2 Running General Purges for ECS Sales Order Management

General purges for the ECS Sales Order Management system include:

  • Sales Order Detail purge

  • Sales Order Detail History purge

  • Sales Order Ledger purge

General purges are DREAM Writer versions of the JD Edwards World general purge program that removes data from a specified file. You run general purges when you want to remove a large amount of data.

You can create DREAM Writer versions of the general purge program to purge data from any JD Edwards World file. However, JD Edwards World recommends that you do not use general purges for files that have their own special purge programs. General purges are not designed for files that have associated data in other files. Running a general purge for such files could cause you to lose data.

The general purges remove records with a next status of 999, or closed, from the specified file.

45.2.1 Creating a New DREAM Writer Version for a Purge

Before creating a new DREAM Writer version to purge a file, verify that a special purge program does not exist for that file. The ledger and balances files require special processing to select records. Those that can be purged have their own specific purge programs.

To create a new DREAM Writer version to purge a file, access the Versions List for P00PURGE. In this example, a P00PURGE version is being created for the Item Location file (F41021) from an existing version that purges the Item History file (F4115).

To Create a New DREAM Writer Version for a Purge

On Versions List.

Figure 45-1 Version List screen

Description of Figure 45-1 follows
Description of "Figure 45-1 Version List screen"

  1. Enter a 3 next to the DEMO version of Item History.

    Figure 45-2 DREAM Writer Version Copy screen

    Description of Figure 45-2 follows
    Description of "Figure 45-2 DREAM Writer Version Copy screen"

  2. Enter a version title that identifies the new purge being created.

    Figure 45-3 Additional Parameters screen

    Description of Figure 45-3 follows
    Description of "Figure 45-3 Additional Parameters screen"

  3. Complete the following fields to reflect the new file:

    • Based on File

    • Format Name

  4. Set Processing Options as desired.

  5. Review the Data Selection.

    Figure 45-4 Data Selection screen

    Description of Figure 45-4 follows
    Description of "Figure 45-4 Data Selection screen"

  6. Note that the existing selection criteria from the Item History has been retained. These fields can be removed by entering N in the Include in Selection field and then pressing F5 to update.

  7. Press F16 to Display All Data Fields of the Based on File field you selected to create your data selection. Enter a Y against the specific fields you want to include.

    Figure 45-5 Data Selection (All Data Fields) screen

    Description of Figure 45-5 follows
    Description of "Figure 45-5 Data Selection (All Data Fields) screen"

  8. As with data selection, the sequence fields from the Item History version is retained. Remove these in a similar manner and then press F16 to Display All Data Fields of the Based on File field you selected to create your data sequencing criteria.

    Figure 45-6 Data Sequence Set-up screen

    Description of Figure 45-6 follows
    Description of "Figure 45-6 Data Sequence Set-up screen"

  9. Enter the numerical sequence for the fields of your version. After you press Enter, your version is created and you are returned to the versions list display.

45.2.2 What You Should Know About

Topic Description
Sales Order Detail purge You specify whether the system writes closed order lines to the Sales Order Detail History file and leaves only canceled order lines in the Sales Order Detail file when you run the Update Customer Sales program.

You use the Sales Order Detail purge to remove records from the Sales Order Detail file. Optionally, you can move the records from the Sales Order Detail file to the Sales Order Detail History file.

See Section 45.3.5, "Running Move Sales Order Detail to History (ECS)."


45.2.3 Processing Options

See Section 50.1, "Batch File Purge (P00PURGE)."

45.3 Running Special Purges (ECS)

JD Edwards World provides special purges for removing data from files where the selection criteria needs to be more specific. Special purges are DREAM Writer programs that have predefined criteria that the system checks before removing any data so that you avoid removing associated data that is located in other files.

Running special purges includes:

  • Running the Sales Order Header purge

  • Running the Extended Text purge

  • Running the Batch Order Files purge

  • Running Move Sales Order Detail to History

45.3.1 Running the Sales Order Header Purge (ECS)

You use the Sales Order Header purge to purge sales order header records from the Sales Order Header file. The system purges records from the Sales Order Header file only if no open detail lines with a matching order type and order number combination exist in the Sales Order Detail file. In addition to purging records, you can optionally move information to the Sales Order Header History file (F42019). You specify in the processing options whether you want to move information. Since this program only selects header records without matching detail records, it is advisable to run it immediately after the corresponding detail purge program.

45.3.1.1 What You Should Know About

Topic Description
Purging header information during sales update You can purge sales order header information from the Sales Order Header file and move it to the Sales Order Header History file during sales update (P42800).

See Section 21.1, "Updating Customer Sales (ECS)."


45.3.2 Running the Sales Order Text Line Purge (ECS)

This Sales Order Text Line program (P42960) is not exactly a purge program in that is does not delete any records. Specifically, the program reads through the Sales Order Detail file (F4211) looking for Text lines (Line type is equal to 'T') that do not have any associated non-text lines. Each record found that matches this criteria is set to closed by having its next status set to 999. These detail records can then be purged by either the general or special Sales Order Detail purges.

45.3.3 Running the Extended Text Purge (ECS)

You use the Extended Text purge to delete specific information from the Text Detail Lines file (F4314).

This purge checks the Sales Order Detail and the Purchase Order Detail files for open detail lines with matching order type and order number combinations. One of the following occurs:

  • If the system does not find matching records, it deletes the extended text from the Text Detail Lines file.

  • If the system finds matching records, it deletes the extended text from the Text Detail Lines file only if the matching detail files have a status of 999.

45.3.3.1 What You Should Know About

Topic Description
Purging active order lines The Extended Text purge removes closed text lines only if all other lines on the order are closed. Order lines whose status is not 999 cannot be purged.

You can use the Sales Order Text Lines program to change the status of text lines to 999 (closed) on orders with no open detail lines. You use this program only if you have not set up the processing options for the Update Customer Sales program to purge text lines for closed orders.


45.3.4 Running the Batch Order Files Purge (ECS)

You can delete processed sales orders from the batch receiver files by using the Batch Order Files purge. The system selects only records with Y in the Processed (Y/N) field of the batch receiver files.

The following files are purged by this program:

  • Batch Receiver File - Order Headings (F4001Z)

  • Batch Receiver File - Order Details (F4011Z)

This purge does not remove records from the Destination Quantity file (F4012Z) or the Unmappable Data file (F4014Z). Use the general purge program to remove data from these files.

45.3.5 Running Move Sales Order Detail to History (ECS)

You run the Move Sales Order Detail to History program to purge detail lines with a status of 999 from the Sales Order Detail file (F4211) and move them to the Sales Order Detail History file (F42119).

You can run this program when you run the Update Customer Sales program.

45.3.5.1 What You Should Know About

Topic Description
Price Adjustment History (F4074) If the processing option is set to purge the Price Adjustment History file, the data is lost since there is no archive file to receive its data.

45.3.5.2 Processing Options

See Section 50.5, "Purge Details to History (P42996)."