Tuesday, 30 July 2013

Easytrieve Basic Reporting

Overview
This section covers the fundamentals of coding an EASYTRIEVE PLUS program. It starts with a brief discussion of conventions (rules) for syntax. Next, there is an explanation of the structure of an EASYTRIEVE PLUS program that outlines the function and configuration of its segments. Finally, the Library and Job Activity segments of an EASYTRIEVE PLUS program are discussed in detail.
Upon completion of this section you will be able to write an entire EASYTRIEVE PLUS program consisting of:
  • Coding the file definition statement.
  • Coding the field definition statements for each requested field.
  • Coding the JOB statement.
  • Coding the logic portion using IF statements to select data for a report.
  • Coding assignment, calculation, and PRINT statements to perform data movements for the report.
  • Coding the report statement.
  • Coding the report definition statements.
Syntax Conventions
Syntax refers to the relationships among the parts of a statement. Syntax refers to the way the parts must be structured, independent of what these parts say or mean.
Delimiters
B   A blank is the basic delimiter. Its purpose is to separate the parts of a statement.

( )   Parentheses indicate more than one sub-parameter. e.g., HEADING (‘EMP’ ‘NO’)

:     A colon is used to qualify non-unique field names. e.g., PERSNL:NAME

,     A comma is never needed, but is optionally used for readability.

 ‘ ‘    Single quotation marks enclose literals, e.g., ‘TEXAS’

.      A period indicates the end of a statement, e.g.,

                 IF DEPT = 910. * DEPT 910 IS ACCOUNTING

*      An asterisk indicates a comment if it is the first non-blank character on a statement.
       No comments are allowed between continuation lines.

Statement Continuation

 +   A plus sign indicates that the statement continues with the first non-blank character
      in the next Statement Area.

      TITLE ‘ABC + DEF’ Prints ABCDEF


Easytrieve Basic Report Field Defination

Field Definition Statement

A field definition specifies data fields within a record on a file.
  • Four parameters are always required: field-name, start-location, field-length, and data-type.
  • Additional parameters include the number of decimal positions for quantitative fields, HEADING and MASK.
Syntax

Field-name      start-location         field-length    data-type    +
[ decimal-positions]         [HEADING ‘literal’ ]                          +
[ MASK { [letter] [BWZ] [‘literal’] } ]

Field-name
You create a field-name or adapt the field name in a record layout for your EASYTRIEVE PLUS program.
  • Field-names must be unique within a file.
  • The name can be 1 to 40 alphanumeric characters.
  • Special characters can be used, but not delimiters.
Start-location
The start location is the beginning location of a field in the record relative to the first position.
  • Start location can be explicitly defined based on position one of the record:

   NAME                   17        16         A
   ADDRESS            37        39         A
   PAY-NET              90         4          P      2
Field-length
You specify the length of a field in bytes (characters and / or spaces).

Data-type
You describe the type of data a field contains by coding the letter for that type after the field-length. There are five data-types.

              Type                               Max. Length ( bytes )

A          Alphanumeric                     32,767
N          Numeric                                 18
P          Packed                                   10
U          Unsigned Packed                     9
B          Binary                                      4
Decimal-positions
By specifying decimal-positions, you:
  • Identify a field to EASYTRIEVE PLUS as being quantitative.
  • Identify the field(s) to be automatically totaled when specified in a CONTROL report.
  • Allow for proper placement of commas and decimals with leading zeros suppressed when the field is printed.
Four types of data can have decimal positions:
                 N                    Numeric
                 P                    Packed
                 B                    Binary
                 U                    Unsigned Packed
Specify the decimal-positions by coding an integer (0 through 18) after the data-type. For example,
AMOUNT                40        5       N      2

Is a five-byte numeric field with two decimal positions.


Monday, 29 July 2013

Easytrieve Basic Report Edit Field Definition.



Easytrieve.
Easytrieve Basic Report Edit Field Definition


HEADING Parameter

You use the HEADING parameter to specify an alternative column heading for a field. (The default column heading is the field-name.)

  • Place the alternate column heading within single quotation marks. For example,
CL-NAME               5       20       A      HEADING ‘CLIENT NAME’

Produce the column heading
          
  CLIENT NAME    

MASK

An edit mask is a pattern of characters specifying how non-alphanumeric data is to be printed. Alphanumeric fields cannot be edited. An edit mask is created using combinations of the following characters:

9     Formats digits.
Z     Suppresses Leading zeroes.
*     Replaces leading zeroes with an asterisk.
-     Prints a minus sign prior to the first non-zero digit of a
      negative number
$    Prints a currency symbol prior to the first non-zero digit.

Each digit in the field must be designated in the mask. Any character which follows the last character of the edit mask is printed if the field is negative.

Example
              Mask             Field         Result
              ------------ ------------ ------------
              $$, $$9        01234       $1,234

Defining Edit Masks

You can define standard edit masks when your system is installed.

       MASK                                     USE
 ‘(999) 999-9999’                 Telephone Number
 ‘999-99-9999’                    Social Security number

 ‘Z9 / 99 / 99’                   Date
 ‘$$, $$$, $$9.99                 CREDIT’ Money (with floating $)

 ‘*, ***, ***, 999.99-‘           Protected Check Amount
 ‘--, ---, -9.99’                 Negative Number

Syntax

[     MASK   [letter]   [BWZ]    [‘literal’]       ]
  • MASK is the EASYTRIEVE PLUS keyword.
  • Letter names the edit mask to follow. Once a mask is defined, it need not be defined again; simply use the letter.
  • BWZ (blank when zero) specifies that a field should not be printed if the entire field contains zeroes. BWZ must be coded whenever needed.
  • Literal is the format of the mask using the characters indicated on the previous page.
Redefining a Field

Sometimes it is necessary to break a field into several parts in order to get the exact information for your report. A birth date, for example, may have been originally entered as one field in a record. Now you want to access this information by either the month, day, or year. With EASYTRIEVE PLUS you can redefine that field in the following manner:

DATE-OF-BIRTH             103         6            N
    MONTH                 103         2            N
    DAY                   105         2            N
    YEAR                  107         2            N


DATE-OF-BIRTH | _ | 0 | 2 | 1 | 0 | 5 | 5 | _ | _ | _ | _ |
 position 103 105 107

 Start-location of New Fields
In this exhibit, the MONTH (02) starts in position 103 and occupies position 103 and 104. The DAY starts in 105 and occupies positions 105 and 106. Finally, YEAR starts in 107 and occupies 107 and 108.lves setting aside as an area of storage as a place to keep calculations or other information that is to be created during the running of an EASYTRIEVE PLUS program.

  • Define working storage by specifying W as the start location.
  • The values stored in this field are associated with each individual record.
Example

GROSS          30         4     N   2
NET            34         4     N   2
WORK-DEDUCT    W          4     N   2  HEADING ‘DEDUCTIONS’


Easytrieve Basic Report Calculation

Calculations

There are four arithmetic operations in EASYTRIEVE PLUS :
*         multiplication
/         division
+        addition
 -        subtraction


Multiplication and division are performed before addition and subtraction in order from left to right. There must be a space before and after the arithmetic operators.

Parentheses in Calculations

Parentheses can be used to override this normal order of operation. Any level of parentheses nesting is allowed. (Operation proceeds from the innermost level to the outermost.)

RESULTS = GROSS - AMT * 1.3

 is the same as:

RESULT = GROSS - (AMT * 1.3)

but different from:

RESULT = (GROSS – AMT) * 1.3

Rounding in Calculations

To round calculations, add a ‘rounding factor’. The ‘rounding factor’ is composed of a decimal point followed by a zero digit for each decimal position in the receiving field followed by the digit 5.

      NEWFLD         W      4     P     2
JOB    INPUT    PERSNL    NAME    PAY1
     NEWFLD   =   (GROSS  *  1.87)  +   .005
PRINT
  • The PRINT statement makes data available for output to a report.
PRINT report-name

Example

IF REG = 25
    PRINT RPT1
END-IF
Only records with a 25 in the REG field are output to the report.


Easytrieve Sorting.

SORT

SORT is an activity that sequences an input file on fields specified as keys. SORT uses the interface to your system sort. You can sort on as many fields as your system allows.
SORT file-name-1     TO       file-name-2               +
           USING    (field-name [D] …)                       +
           NAME sort-name
         
          [ BEFORE proc-name ]

File-name-1 is the input file to be sorted.

File-name-2 is the output file.

USING field-name identifies those fields from file-name-1 that you use as sort keys. Specify sort keys in major to minor order.

D optionally sorts the field contents in descending order (default = ascending order).

NAME sort-name identifies the sort activity for documentation purposes.

Example

FILE PERSNL FB ( 150 1800 )
           NAME              1      10       A
           DEPT              11       5       N
           GROSS-PAY 16       4       P    2
FILE PAY-SORT FB ( 150 1800 )
      SORT PERSNL TO PAY-SORT               +
                USING ( DEPT GROSS-PAY )      +
                NAME SORT-EXAMPLE-1

SORT Procedure

You use SORT procedure to select only certain records for sorting and / or to modify the contents of records before a sort.
  • A SORT procedure immediately follows the SORT statement.
  • You invoke a SORT procedure with the BEFORE parameter.
  • The SORT procedure executes for each record from file-name-1 prior to passing the record to the sort.
Example
This example illustrates the use of the SORT activity and SORT procedures.

FILE PERSNL FB (150 1800)
          NAME 1 10 A
          DEPT 11 5 N
          GROSS-PAY 16 4 P 2
FILE PAYSORT F(19) VIRTUAL
          SORT-NAME 1 10 A
          SORT-DEPT 11 5 N
          SORT-GROSS-PAY 16 4 P 2
JOB INPUT PERSNL NAME ACT-1
          PRINT RPT1
REPORT
       LINE 1 NAME DEPT GROSS-PAY
SORT PERSNL TO PAYSORT USING (SORT-DEPT + SORT-GROSS-PAY D) BEFORE SELECT-SORT NAME SORT-ACT
SELECT-SORT. PROC
         IF SORT-GROSS-PAY GE 500
                   SELECT
         END-IF
END-PROC
JOB INPUT PAYSORT NAME SORT-PROC-EX
** Logic **


GET Statement

The GET statement retrieves the next record of the named file into the file input area.
GET file-name

file-name - identifies the input file

(EOF) - Test for end-of-file (EOF) when using the GET command.

Example FILE MASTER FB ( 150 1800 )
         EMP#         9       5        N
         NAME      17     16        A
         GROSS   94       4        P      2
JOB INPUT NULL NAME READ-SEQ-MAN
GET MASTER
           IF EOF MASTER
                  STOP
           END-IF
          IF GROSS > 500
               PRINT RPT1
          END-IF
REPORT RPT1
        LINE 1 EMP# NAME GROSS

* You use NULL in the JOB statement to inhibit automatic input.

PUT Statement

The PUT statement outputs a file sequentially.
Example 1

FILE PERSNL FB ( 150 1800 )
       EMP#          9      5     N
       NAME       17     16    A
       GROSS     94      4     P   2
FILE NEWPAY2 F(20) VIRTUAL RETAIN
       NAME          1     16    A
       GROSS     17       4     P  2
JOB INPUT PERSNL NAME PUT-EXAMPLE
       ** Logic **
MOVE LIKE PERSNL TO NEWPAY2
PUT NEWPAY2


Easytrieve Library.

EasytrieveLibrary

FILE Statement

The FILE statement describes an input or output file and is coded in the Library section of an EASYTRIEVE PLUS program. The syntax of the FILE statement is determined by the type of system you are using to run EASYTRIVE PLUS programs.




Virtual File Manager (VFM)

VFM provides an easy method for establishing temporary work files without special job control or file allocation statements. VFM is a sequential access method for program work files. It dynamically allocates space in memory for work files when sequencing a report or when producing multiple reports.
  • When a virtual file is read back into the program, space is released and becomes available for reuse unless you code RETAIN on the statement.
  • If the area in memory (default is 16k) is exhausted, VFM writes the excess data to a single spill area on disk.
              FILE    file-name    F  (lrecl)    VIRTUAL   [ RETAIN ]

F (lrecl) designates the record length.

VIRTUAL causes the file to be created and maintained by the VFM.

RETAIN causes VFM files to be retained for the duration of the EASYTRIEVE PLUS program execution.

COPY Statement

The COPY statement duplicates the field definitions of a named file. You can code an unlimited number of COPY statements for any one file.

COPY { file-name }
When the same field-name is used in more than one file in the same activity, you must qualify duplicate field-names by adding the file-name as a prefix separated by a colon.
Example

FILE INONE
         FLD-ONE            10      1      A
         FLD-TWO           11      3      N
FILE INTWO
-->     COPY       INONE
JOB  INPUT   INTWO     NAME    COPY-EXAMPLE
        IF  INTWO:  FLD-ONE
** Logic **

EXIT parameter

The EXIT parameter on the FILE statement invokes a user routine for every input or output operation for that file.
  • You use EXIT to access a routine that converts non-standard data files that EASYTRIEVE PLUS does not process directly.
  • EXIT is not valid for VFM or IMS / DLI. (IMS / DLI information is contained in APPENDIX D of this Student Guide.)
FILE   file-name    [EXIT (program-name [NR]                   +
          USING ( field-name … )         [ MODIFY ] ) ]

NR has meaning only in DOS; NR indicates that the program is non-relocatable.

USING specifies the parameters to be passed.

MODIFY specifies that the exit can inspect and modify each record after input or before output.


Easytrieve Advance Topic File Handling.

VSAM File Creation (Loading)

The FILE statement and the PUT statement are used to create (load) VSAM files. The PUT statement provides for sequential file output to VSAM files.

FILE MASTER FB ( 150 1800 )
             EMP#           9       5     N
             NAME        17     16    A
             GROSS      94      4     P  2
FILE OUTMAST VS ( CREATE RESET )
         JOB INPUT MASTER NAME CREATE-VSAM
          PUT OUTMAST FROM MASTER STATUS
          IF OUTMAST: FILE-STATUS NOT ZERO
          DISPLAY ‘LOAD ERROR STATAUS IS : ‘       +
                          OUTMAST : FILE-STATUS
         STOP
END-IF
         PRINT RPT1
REPORT RPT1
         LINE 1 EMP# NAME GROSS

STATUS

When you specify STATUS, VSAM return codes are returned to the system defined field FILE-STATUS.

FILE-STATUS
FILE-STATUS is a system defined field which you can test to identify the result of a VSAM input / output operation.

Easytrieve Advance Topic Activity

CALL Statement

The CALL statement invokes an external subprogram. Usually, the CALLed program is an existing program in another language that performs an unsupported function.

CALL program-name [NR] USING ( field-name … )

MOVE Statement

You use the MOVE statement to transfer data from one location to another. MOVE is useful for moving data without conversion and for moving character strings with variable lengths.
  • You can move a field or a literal to a field or move a file to a file.
  • A sending field longer than a receiving field is truncated on the right.
  • A longer receiving field is padded on the right with spaces or an alternate fill character.
  • Spaces or zeroes can be moved to one or many fields.
MOVE NAME 20 TO HOLD-NAME
MOVE NAME CTR TO HOLD-NAME FILL ‘*’
MOVE SPACES TO NAME, HOLD-NAME, HOLD-DIV

MOVE LIKE file-name-1 TO file-name-2

MOVE LIKE

MOVE LIKE moves the value of fields with identical names from one file to another while converting numeric data-types from one format to another.
  • The rules for the assignment statement also apply to MOVE LIKE.
  • Because the same field-name can be used in more than one file, you must qualify duplicate field-names by prefixing the field-name with the file-name and a colon.
User Procedures (PROCs)
A user PROC is a group of user-written EASYTRIEVE PLUS statements designed to accomplish a task. You use a user PROC when identical logic is needed in several places in the activity.
A user PROC must be invoked in the activity with a PERFORM statement.
PERFORM proc-name

 proc-name. PROC
       ** Logic **
END-PROC


Proc-name

Proc-name is the same name as in the PERFORM statement and is followed by a period, a space, and the keyword PROC.

END-PROC

Every PROC must have an END-PROC. At END-PROC, control returned to the statement following the PERFORM statement that invoked the PROC

START / FINISH parameters

You use the optional START and FINISH parameters of the JOB statement to automatically incorporate procedures into processing activities.
JOB input file-name [ NAME job-name ] + [ START proc-name ] [FINISH proc-name]

START parameter

You use START to identify a procedure to be executed during initiation of the JOB activity.
  • The procedure is invoked automatically after the file are opened and prior to the first input record.
  • A typical START procedure might initialize working storage fields or establish a position in a keyed sequenced file.
FINISH parameter

You use FINISH to identify a procedure to be executed during the normal termination of the JOB activity.
  • The procedure is invoked after the last input record is processed and before the files are closed.
  • A typical FINISH procedure displays control information accumulated during execution of the JOB activity.
  • A FINISH proc is invoked if a STOP is encountered but it is not invoked if a STOP EXECUTE is encountered.
GOTO Statement

You use the GOTO statement to modify the natural top-to-bottom logic flow in a program.
GOTO JOB transfers control to the top of current JOB activity.
Example

JOB INPUT PERSNL NAME DIV-LIST
     IF DIV = ‘A’
  ---->          GOTO JOB
    END-IF
    IF DIV = ‘B’
  ---->         GOTO CHECK-REG-RTN
     END-IF
       ** Logic **
   CHECK-REG-RETURN

DO WHILE / END-DO Statements

You use the DO WHILE and END-DO statements to provide a controlled loop for repetitive program logic.
  • The logic between DO WHILE and END-DO is executed until the conditional expression on the DO WHILE statement is false.
  • Conditional expressions follow the rules of IF statements.
JOB INPUT PERSNL NAME DO-EX-1
CTR = 0
DO WHILE CTR LT 10
           CTR = CTR + 1
            ** Logic **
END-DO
IF …
Nesting Example

You can nest DO WHILE statements. (The inner logic loop must be completely within the outer logic loop.)




EASYTRIEVE Tutorial || Easytrive Program Structure || Easytrieve Reporting Example.


Hello! and welcome back to another exciting tutorial on EASYTRIEVE Program. In this Easytrive tutorial, you'll learn the basic structure of an Easytrive program.  You'll get a flavor of the Easytrieve program.  Let's start with today's tutorial with an introduction to the Earyteive program sections.  

Easytrive Introduction.

Easytreive on the mainframe is a data retrieval programming language. Easytrieve is generally used for creating custom reports, extract data. Let's focus on an Easytrive sample reporting program. 

Easytrive Program Structure.

The Easytrive program generally has three different sections (i.e. environment section, library section, activity section). Each section has its own significance. Let's look at each section in detail. 

ENVIRONMENT Section.

An Easytrive Environment section optional. It is generally used to change the default parameters of the system environment. The PARM keyword is used to specify the new parameters. 

For example- PRAM LINK (EZTBPGM2)

LIBRARY Section.

The Easytrive Library section specifies the input and output file used in the program. This section is also used to define the working storage fields for the program logic.   

For example - FILE PERSNL  

Note: In the above mention example, PERSNL is the name of a file used in an easytrive program.

ACTIVITY Section.

The last section of an Easytrive program is the Activity Section. This is a mandatory section and it is to specify the business logic of the program. The activity section can have any number of small tasks in the form of paragraphs. Each paragraph represents a set of business rules or logic as per need.  

Mainframe Forum - Easytrieve Program Flow

Easytrive Sample Reporting Program.

  • Program Name: EZTBRP01
  • Description: EZTBRP01 is an easytrive program, that generates reports in specific formats.

*
 INPUT 
*
 FILE  PERSNL   FB   (150 1800) 
       NAME           17     20    A 
       EMP#           9       5    N 
       DEPARTMENT     98      3    N 
       NET            90      4    P  2  
       GROSS          94      4    P  2 
 JOB INPUT PERSNL NAME EXAMPLE-ONE 
 PRINT PAY-RPT 
*
 REPORT  JOB  INPUT  PERSNL  NAME  EXAMPLE-ONE 
 PRINT  PAY-RPT 
*   REPORT  PAY-RPT 
 TITLE 1 ‘PERSONNEL  REPORT  EXAMPLE  ONE’ 
 LINE 1 NAME  DEPARTMENT  EMP#  GROSS NET

REPORT OUTPUT 

4/16/86                PERSONNEL REPORT EXAMPLE ONE                   PAGE 1
 NAME             DEPARTMENT         EMP#              GROSS          NET
 NAGLE               935             00370             554.40         340.59 
 POST                911             00445             292.00         206.60 
 PETRIK              921             00577             220.80         154.70 

Mainframe Generation Data Group (GDG): The Power of Generation Data Group!


Generation Data Group Overview.


Generation Data Group (GDG) is a concept that has been widely adopted in mainframe computing, where managing large volumes of data is a critical task. A GDG is a collection of two or more chronologically related versions of the same data set, stored as separate generations. This allows organizations to efficiently manage data while retaining access to historical versions for disaster recovery, auditing, and other purposes. 

In this article, we will take a closer look at what GDGs are, how they work, and why GDGs are essential for mainframe data management. From their definition, and evolution to their use in modern mainframe environments, this article will provide a comprehensive overview of the world of Generation Data Groups (GDG) in Mainframe.

What is Generation Data Group?

A Generation Data Group (GDG) is a collection of two or more chronologically related versions of the same data set, stored as separate generations. This allows for efficient management of data and the ability to access historical versions of the data set. GDGs are commonly used in mainframe computing, where data is frequently processed in large batch jobs and where keeping multiple generations of the data set can be important for disaster recovery and auditing purposes.

What are the benefits of using GDGs in the Mainframe?

The following are some benefits of using Mainframe Generation Data Group (GDG):
  • Efficient Data Management: GDGs allows for the efficient management of large volumes of data by storing multiple generations of the same data set, reducing the need for manual organization and management.
  • Access to Historical Data: With GDGs, organizations have access to historical versions of their data sets, which can be important for disaster recovery, auditing, and compliance purposes.
  • Improved Data Retention: GDGs can help organizations retain important data, such as backups and archives, for longer periods of time, reducing the risk of data loss.
  • Increased Data Security: By storing multiple generations of data sets, GDGs can improve data security and reduce the risk of data breaches or unauthorized access to sensitive information.
  • Streamlined Backup and Recovery: GDGs can simplify the process of backing up and recovering data, allowing organizations to quickly recover critical data in the event of a disaster.
  • Better Data Auditing: By keeping multiple generations of data sets, GDGs can improve data auditing and make it easier to track changes and maintain compliance with regulatory requirements.
  • Improved Resource Utilization: GDGs can help organizations optimize resource utilization by reducing the need for manual data management and allowing for more efficient use of storage and computing resources.

 

How do you define a Mainframe GDG (Generation Data Group)?

To define a Generation Data Group (GDG), you must create a catalog entry for the GDG, and create a model data set control block on the same volume as the catalog entry for the GDG. Additionally, you must create a GDG catalog entry, by invoking the VSAM utility program, AMS, and issue a DEFINE GDG command. 

DEFINE Generation Data Group Syntax.

DEFINE GDG|GENERATIONDATAGROUP
      ( NAME(entry-name)
        LIMIT(limit)
      [ EMPTY | NOEMPTY ]
      [ SCRATCH | NOSCRATCH ]
      [ OWNER(owner-id) ]
      [ TO(yyyyddd) | FOR(nnnn) ] )



Name Specifies the name of the generation data group. This name follows normal data set naming conventions but is limited to 35 characters.
LIMIT Specifies how many generation data sets are to be maintained in the group. The maximum limit is 255.
EMPTY | NOEMPTY Specifies what action should be taken when the LIMIT value is reached. EMPTY means that all generations should be removed from the group. NOEMPTY means that just the oldest generation should be removed.
SCRATCH | NOSCRATCH Specifies whether the data sets that are removed from the group should be scratched (deleted) or just un-cataloged.
TO | FOR Specifies an expiration date or a retention period for the GDG.

Sample JCL to  define a generation data group (GDG) 


//JOB123 JOB (12345),'RC MAINFRAME', CLASS=0,
//            MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//MODEL DD   DSNAME=RCTM.EMPPAYRL.MNTH.GDG,
//           DISP=(NEW,KEEP,DELETE),UNIT=DISK,
//           SPACE=(CYL,(10,10),RLSE),
//           DCB(DSORG=PS,RECFM=FB,LRECL=80)
//SYSIN DD *
  DEFINE GDG (NAME(PRRT.PAYROLL.MONTH.GDG) -
  LIMIT(30) -
  SCRACTH -
  EMPTY)
/*
//

Note: In above mention example, the job would define the new Generation Data Group (GDG) base (i.e. RCTM.EMPPAYRL.MNTH.GDG) with a limit of 30. We have used IDCAM's utility to define, however same can be achieved FILE-AID / FILE-MANAGER or using ISPF utility. 

DELETE Generation Data Group (GDG) Syntax.

DELETE  entry-name
        GDG|GENERATIONDATAGROUP
        [ PURGE|NOPURGE ]

        [ FORCE|NOFORCE ]

entry-name Provide the name of the GDG catalog entry that is to be deleted.
GDG Specifies that the entry to be deleted is a generation data group.
PURGE Deletes the catalog entry even if the expiration date hasn’t been reached. When used with FORCE, it deletes the catalog entry and the GDG members even if any of their expiration dates haven’t been reached.
FORCE Forces the GDG catalog entry and all of its members to be deleted, assuming that the expiration dates have passed or that PURGE is coded.


Sample JCL to  delete a generation data group (GDG) 

//JOB123 JOB (12345),'RC MAINFRAME', CLASS=0,
//            MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSIN DD *
 DELETE MM01.PAYROLL.MASTER GDG   -
 PURGE                            –
 FORCE
/*

Youtube: Generation Data Group (GDG) Tutorial.



Conclusion. 

In conclusion, the Mainframe Generation Data Group (GDG) is an essential tool for managing and organizing data in mainframe environments. With its ability to efficiently manage large volumes of data, provide access to historical data, simplify backup and recovery processes, improve data auditing, and optimize resource utilization, GDGs provide a comprehensive solution for organizations that rely on mainframes for their data processing needs. 

As data management continues to evolve and become more complex, GDGs will remain a crucial component of mainframe data management, ensuring that organizations can effectively manage their data and meet the demands of their growing business.


Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on - 

► Youtube
► Facebook 
► Reddit

Thank you for your support. 
Mainframe Forum™

New In-feed ads