61 Purge Data

This chapter contains these topics:

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

61.1 Purging Data

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.

You can run two types of purges within distribution systems:

  • Running General Purges

  • Running Special Purges

General purges are versions of the JD Edwards World general purge program (P00PURGE) that removes data from a specified file. You run them 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 programs that have predefined criteria that the system checks before removing any data so you avoid removing associated data located in other files.

61.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 recommend 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.


61.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

61.2 Running General Purges

Navigation

From Sales Order Management (G42), choose hidden selection 27

From Sales Order Advanced & Technical Operations (G4231), choose Data File Purges

From Data File Purges (G42312), choose an option

General purges for the Sales Order Management system include:

  • Sales Order Detail purge

  • Sales Order Detail History purge

  • Sales Order Ledger purge

General purges are 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 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.

61.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 doesn't 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).

On Versions List

Figure 61-1 Versions List screen

Description of Figure 61-1 follows
Description of "Figure 61-1 Versions List screen"

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

    Figure 61-2 DREAM Writer Version Copy screen

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

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

    Figure 61-3 Additional Parameters screen

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

  3. Enter 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 61-4 Data Selection screen

    Description of Figure 61-4 follows
    Description of "Figure 61-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 the fields from the based on file that you can select from to create your data selection. Enter a Y against the specific fields you want to include.

    Figure 61-5 Data Selection (All Fields) screen

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

  8. As with data selection, the sequence fields from the Item History version will be retained. Remove these in a similar manner and then press F16 to display all the fields from the based on file you can select from to create your data sequencing criteria.

    Figure 61-6 Data Sequence Set-up screen

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

  9. Enter numerical sequence numbers against the fields your version to be sequenced by. After pressing enter your version will have been created and you will be returned to the versions list display.

61.2.2 What You Should Know About

Topic Description
Sales Order Detail purge When you set up order line types, you specify whether the system writes closed order lines to the Sales Order Detail History and leaves only cancelled 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 61.3.8, "Running Move Sales Order Detail to History."

Sales Order Detail Ledger Within each step of the order activity rules there is a flag that determines whether a record from the Sales Order Detail file (F4211) is written to the Sales Order Detail Ledger file (F42199). As well as providing valuable historical information as orders progress through the system, the Sales Ledger file is also used for creating credit orders from history. It is also the basis of the Sales Ledger Inquiry program and Sales Ledger Detail reports.

61.2.3 Processing Options

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

61.3 Running Special Purges

Navigation

From Sales Order Management (G42), choose hidden selection 27

From Sales Order Advanced & Technical Ops (G4231), choose Data File Purges

From Data File Purges (G42312), choose an option

JD Edwards World provides special purges for removing data from files where the selection criteria needs to be more specific. Special purges are 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 involves:

  • Running the Sales Order Header purge

  • Running the Extended Text purge

  • Running the Batch Order Files purge

  • Running Move Sales Order Detail to History

61.3.1 Running the Sales Order Header Purge

Use the Sales Order Header purge to purge sales order header records from the Sales Order Header file. Records are purged 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) by setting the appropriate processing option. Since this program only selects header records without matching detail records it is advisable to run it immediately after the corresponding detail purge program.

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 Chapter 34, "Update Sales Information."


61.3.3 Running the Sales Order Text Line Purge

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.

61.3.4 Running the Extended Text Purge

You use the Extended Text purge to delete specific information from the Text Line 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 Line file.

  • If the system finds matching records, it deletes the Extended Text from the Text Line file only if the matching detail files have a status of 999.

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.


61.3.6 Running the Batch Order Files Purge

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)

  • Sales Order Detail File - Tag File from Transportation (F49211Z)

This purge does not remove records from the Destination Quantity file (F4012Z). Use the general purge program to remove data from this file.

61.3.8 Running Move Sales Order Detail to History

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 History file (F42119).

This process can also be achieved as part of the Sales Update program.

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 will be lost since there is no archive file to receive its data.