Top Banner
CA EASYTRIEVE ® to DATAMINER Upgrade Guide Release 8.2 DATAMINER FOR z/VSE and z/OS DATAMINER is a collection of powerful data mining and data- manipulation tools. These tools allow non-programmers to easily access information in files and DB2 databases. Using DATAMINER, you can Browse, change, copy, or print files and DB2 databases Move data from one record to another, or from one file type to another, and Reformat the data at the same time. DATAMINER allows you to interact with files in two ways: Access VSAM and sequential files in batch mode. Retrieve, view, and update VSAM and temporary storage queues using the online interface. DATAMINER enables you to report on and extract information based on parameters you specify. Its flexible Report Writer allows you to create custom reports, and you can print labels in a multicolumn format. DATAMINER Comprehensive Information and Data-Management System
43

DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Jan 10, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

CA EASYTRIEVE ® to DATAMINER Upgrade Guide

Release 8.2

DATAMINER FOR z/VSE and z/OS

DATAMINER is a collection of powerful data mining and data-manipulation tools. These tools allow non-programmers to easily access information in files and DB2 databases. Using DATAMINER, you can

• Browse, change, copy, or print files and DB2 databases

• Move data from one record to another, or from one file type to another, and

• Reformat the data at the same time.

DATAMINER allows you to interact with files in two ways: • Access VSAM and sequential files

in batch mode. • Retrieve, view, and update VSAM

and temporary storage queues using the online interface.

DATAMINER enables you to report on and extract information based on parameters you specify. Its flexible Report Writer allows you to create custom reports, and you can print labels in a multicolumn format.

DATAMINER Comprehensive Information and Data-Management System

Page 2: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Copyright © 2017–2021 by Connectivity Systems, Inc.

All Rights Reserved

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government is subject to the restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.

This material contains confidential and proprietary material of Connectivity Systems, Inc., hereafter referred to as CSI International and CSI, and may not be used in any way without written authorization from CSI International. This material may not be reproduced, in whole or in part, in any way, without prior written permission from CSI International.

Permission is hereby granted to copy and distribute this document as follows: • Each copy must be a complete and accurate copy. • All copyright notices must be retained. • No modifications may be made. • Use of each copy is restricted to the evaluation and/or promotion of CSI

International’s DATAMINER FOR z/VSE (DATAMINER FOR z/OS) product or in accordance with a license agreement.

CA EASYTRIEVE® to DATAMINER Upgrade Guide Release 8.2 June 2021

Published by CSI International Phone: 800-795-4914

Internet: http://www.csi-international.com

Email: [email protected]

Support: [email protected]

Sales: [email protected]

Page 3: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

iii

Table of Contents

1. Introduction ............................................................................................................................ 1

What is DATAMINER? .................................................................................................... 1 Why Upgrade to DATAMINER? ........................................................................................ 1 About This Guide .......................................................................................................... 1

2. Upgrade Steps ......................................................................................................................... 3 Overview ...................................................................................................................... 3

3. Feature Comparisons .............................................................................................................. 5 Introduction .................................................................................................................. 5 Environment Section ...................................................................................................... 5 Library Section .............................................................................................................. 6 Activity Section ............................................................................................................. 6 DATAMINER Script Example ........................................................................................... 7

Many Keywords/Functions Are Common..............................................................................11 Sorting Files ......................................................................................................................13 Data Manipulation ..............................................................................................................14

Field Assignments .........................................................................................................14 Arithmetic Expressions ..................................................................................................14

Decision and Branching Logic .............................................................................................15 IF, ELSE, ELSE-IF, and END-IF Statements ...................................................................15 CASE, WHEN, and ENDCASE Statements .....................................................................15 DO WHILE and END-DO Statements .............................................................................15 GOTO Statements and Labels ........................................................................................15 Procedures ...................................................................................................................16

Input and Output ................................................................................................................17 TABLE Processing .............................................................................................................18 Macro Processing ...............................................................................................................19 Listing Control Statements ..................................................................................................20 Virtual File Support ............................................................................................................21 DB2 Database Processing ....................................................................................................22 Simple Reports ..................................................................................................................23

Page 4: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Table of Contents

iv

Report Writer.....................................................................................................................24 Overview .....................................................................................................................24 REPORT Operands .......................................................................................................24 REPORT Subcommands ................................................................................................26 REPORT Procedures .....................................................................................................26 REPORT System Variables ............................................................................................27

Creating a Formatted Report ................................................................................................28 Overview .....................................................................................................................28 Step 1—Specify the Input File ........................................................................................28 Step 3—Specify How to Read Input Records ...................................................................28 Step 4—Optionally Select Records .................................................................................29 Step 5—Optionally Perform Computations ......................................................................29 Step 6—Use PRINT to Print a Report ..............................................................................29 Step 7—Use REPORT Subcommands to Define the Format ...............................................29 Step 8—Optionally Define a Report Writer Procedure .......................................................30

Report Writer Script Example ..............................................................................................31 Designing a Report’s Format ...............................................................................................32

Page 5: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

1

1 1. Introduction

DATAMINER FOR z/VSE or z/OS, hereafter referred to as “DATAMINER,” is a collection of powerful data mining and data-manipulation tools. These tools allow programmers and non-programmers alike to easily access information in your files.

DATAMINER is the logical alternative to CA Easytrieve® and similar data mining, manipulation, and reporting products.

Switching to DATAMINER is an upgrade!

• DATAMINER is an excellent value proposition. It provides all the features you need to meet your work requirements—and at a lower cost. Your Return on Investment is assured.

• DATAMINER was developed specifically for the mainframe environment, both z/VSE and z/OS. You do not need to worry about losing features or functionality in future releases because the product was recoded to run on other platforms.

• CSI International is developing DATAMINER to add unique features. These features will give DATAMINER even greater flexibility to access, process, and report data from new data sources.

The DATAMINER Script Wizard is an example of such a feature. The Script Wizard is a 3270-type terminal graphical user interface for creating and running DATAMINER command scripts on z/OS. It offers a convenient way to quickly process or visually examine sequential and VSAM files, including filtering, extraction, and totalization. It operates just as DATAMINER does in a batch job but without the need to construct JCL or submit jobs.

The remaining sections of this guide compare key features in CA Easytrieve and DATAMINER. These sections cover the types of statements you use to construct a DATAMINER script. Other sections show how you can easily print a formatted report using DATAMINER’s

What is DATAMINER?

Why Upgrade to DATAMINER?

About This Guide

Page 6: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 1 Introduction

2

powerful Report Writer. This feature allows you print a sectioned report based on the values of data objects you specify.

To explore all DATAMINER’s features, including its capability to run Natural programs, please see one of the following manuals:

• DATAMINER for z/OS User Reference & Installation Notes

• DATAMINER for z/VSE User Reference & Installation Notes

Page 7: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

3

2 2. Upgrade Steps

Upgrading to DATAMINER can be as simple as following these few steps:

1. Install the DATAMINER batch component. Refer to the “Installation Notes” section in the DATAMINER User Reference manual.

2. Choose an existing CA EASYTRIEVE program, and change these items:

A. Change EZTPA00 to CSIDMBMD on your EXEC statement.

B. Change your STEPLIB or LIBDEF to reference the DATAMINER install load library.

3. Review the Global Options chapter in the DATAMINER User Reference manual, and customize the DATAMINER environmental defaults to meet your site’s needs.

4. Make any other changes necessary. There may be no other changes required. Refer to the list of differences between CA EASYTRIEVE and DATAMINER in this document.

5. Execute the job.

It’s just that easy to upgrade from CA EASYTRIEVE to DATAMINER.

Many documented DATAMINER control commands are common to both DATAMINER and CA EASYTRIEVE. Some CA EASYTRIEVE commands are not common with DATAMINER commands but are supported.

In many cases, DATAMINER can process existing CA EASYTRIEVE programs with few or no alterations. You define input/output files and record fields the same way. Program flow is processed with similar or identical command syntax.

The DATAMINER Report Writer handles defining and generating reports the same as CA EASYTRIEVE.

Overview

Page 8: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 2 Upgrade Steps

4

Page 9: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

5

3 3. Feature Comparisons

Same Program/Script Structure What CA EASYTRIEVE calls a program, DATAMINER calls a script. The structure of a DATAMINER script is the same as a CA EASYTRIEVE program. CA EASYTRIEVE calls the three sections of a program

• Environment

• Library, and

• Activity

By comparing these sections to a DATAMINER script, you can see how similar DATAMINER and CA EASYTRIEVE truly are.

DATAMINER provides the OPTION command to set customized configuration values for a script, but the CA EASYTRIEVE PARM statement is supported as well. Using OPTION with the LINK parameter directs DATAMINER to compile and link a load module for later execution. DATAMINER’s default action is “compile and go,” which means parse, compile, and execute the script, all in the same step. Debugging is accomplished with the DATAMINER TRACE command.

DATAMINER handles unsupported PARM statement operands. Existing PARM statements do not need to be adjusted, modified, or removed before running a script. If an unsupported or unknown PARM parameter is encountered, DATAMINER logs a warning message and continues processing the script.

Environmental defaults for all scripts can be set in DATAMINER’s global options table (CSIDMOPT). This table provides the same function as CA EASYTRIEVE’S EZTPOPT module.

Introduction

Environment Section

Page 10: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

6

The FILE Statement. DATAMINER uses the INPUT and OUTPUT commands to define files to the script. The EASYTRIEVE FILE command syntax is supported, however, including the VIRTUAL, EXIT, and SQL operands. The RECORD-LENGTH, RECORD-COUNT, and FILE-STATUS system variables you are familiar with are supported for each file. The TABLE operand is also supported along with DATAMINER’s native TABLE command.

DATAMINER handles unsupported FILE statement operands. Existing FILE statements do not need to be adjusted, modified, or removed before running a script. If an unsupported or unknown FILE parameter is encountered, DATAMINER logs a warning message and continues processing the script.

Virtual files are managed by the DATAMINER Virtual File Manager (VFM). You use the VIRTUAL file type on a FILE statement to specify a virtual file. The VFM can be configured in the global options table or by the OPTION command in a script to use 64-bit storage (for z/OS) or dataspaces.

The DEFINE Statement. DATAMINER uses the DEFINE command the same as CA EASYTRIEVE. DATAMINER fieldname rules are similar—names can be 32 characters long and must start with a character. Fields can be redefined the same as with CA EASYTRIEVE by referencing a previous fieldname and optionally adding an offset. DATAMINER detects the subtle difference between record fields and user variables (work fields), but it also allows for the CA EASYTRIEVE W or S location indicators. All location parameters and more are supported. The attribute parameters A (alphabetic), N (zoned-decimal), P (packed), B (binary), and more are supported.

The optional parameters MASK, VALUE, HEADING, and VARYING are supported. Field arrays are supported with the optional INDEX and OCCURS parameters. Arrays can be referenced with subscript variables of any numeric type (binary length 1–4, zoned 1–16, and packed 1–8).

What CA EASYTRIEVE calls a statement, DATAMINER calls a command. DATAMINER commands are free flowing and do not require a continuation character when they extend onto more than one input card.

DATAMINER supports the CA EASYTRIEVE statement structure and syntax rules. Terminating statements with a period, statement continuation, and commenting conventions are all supported. Literals and numeric values are specified in the same fashion. The DATAMINER global option parameters CONT and CONT2 can be set to the plus (+) and minus (-) characters, respectively, to direct DATAMINER to detect and process these CA EASYTRIEVE continuation characters.

CA EASYTRIEVE has JOB and SORT activities. Any number of either is allowed in a CA EASYTRIEVE program or a DATAMINER script. DATAMINER refers to these activities as tasks.

Library Section

Activity Section

Page 11: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

7

The CA EASYTRIEVE JOB statement is equivalent to the DATAMINER AUTO command. Each causes the program/script to function in an automatic read mode. Scripts can alternatively process the input file(s) manually with the READ command. Each AUTO or SORT command in a DATAMINER script marks the start of a separate task.

DATAMINER has its own SORT command syntax, but it also supports the CA EASYTRIEVE SORT statement syntax.

The DATAMINER Report Writer script example below looks and performs very similarly to a CA EASYTRIEVE program. One difference is that the script uses the AVG report subcommand to simplify the average calculations. CA EASYTRIEVE requires a report procedure to calculate the averages. DATAMINER supports all CA EASYTRIEVE report procedures.

The script uses common CA EASYTRIEVE statements and shows how closely DATAMINER’s and CA EASYTRIEVE’s syntaxes match. 1 2 * 3 * DEFINE THE INPUT EMPLOYEE VSAM FILE AND CORRESPONDING 4 * RECORD FIELDS 5 6 FILE EMPVSAM VS 7 EMPNO 1 6 C 8 FIRSTNME 9 10 A 9 MIDINIT 19 1 A 10 LASTNAME 22 13 A 11 WORKDEPT 35 3 C HEADING('DEPT') 12 PHONENO 38 4 N 13 HIREDATE 42 10 C 14 HIRE-YEAR HIREDATE 4 N 15 HIRE-MONTH HIREDATE+5 2 N 16 HIRE-DAY HIREDATE+8 2 N 17 JOBTITLE 52 8 C 18 SALARY 73 5 P 2 19 BONUS 78 5 P 2 20 COMM 83 5 P 2 21 22 * 23 * DEFINE WORK FIELDS USED IN THE SCRIPT 24 * 25 26 YEARS-WORKED W 2 P 0 27 RAISE W 2 P 0 28 CURR-DATE S 12 C 29 CURR-MONTH CURR-DATE 2 N 30 CURR-DAY CURR-DATE+3 2 N 31 CURR-YEAR CURR-DATE+6 4 N 32 33 * 34 * DEFINE OUTPUT LOGFILE 35 * 36 37 FILE LOGFILE PRINTER 38 * 39 * THIS SCRIPT AUTO READS THE EMPLOYEE FILE AND CALCULATES RAISES

DATAMINER Script Example

Page 12: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

8

40 * 41 JOB INPUT EMPVSAM 42 43 IF WORKDEPT = 'E11' 44 DISPLAY LOGFILE 'NO RAISE FOR' FIRSTNME LASTNAME 45 GO TO JOB 46 END-IF 47 48 PERFORM SET-RAISE 49 50 CURR-DATE = SYSDATE-LONG. /* GET CURRENT DATE (MM/DD/YYYY) 51 YEARS-WORKED = CURR-YEAR - HIRE-YEAR. /* CALC NUM OF YEARS WORKED 52 53 IF YEARS-WORKED > 50 54 RAISE = RAISE + 5 55 END-IF 56 DISPLAY LOGFILE 'RAISE FOR' FIRSTNME LASTNAME 'IS' +1 RAISE -4 '%' 57 58 PRINT DETAIL-REPORT 59 PRINT SUMMARY-REPORT 60 61 * SET RAISE PERCENTAGE 62 * 63 PROC SET-RAISE 64 IF JOBTITLE = 'MANAGER' 65 RAISE = 15 66 GOBACK 67 END-IF 68 IF JOBTITLE = 'DESIGNER' 69 RAISE = 10 70 GOBACK 71 END-IF 72 RAISE = 5 73 END-PROC 74 75 ** DEFINE EMPLOYEE DETAIL REPORT 76 * 77 REPORT DETAIL-REPORT 78 SEQUENCE WORKDEPT LASTNAME 79 CONTROL WORKDEPT 80 TITLE 1 'EMPLOYEE DETAIL REPORT' 81 LINE WORKDEPT LASTNAME SALARY BONUS COMM YEARS-WORKED RAISE 82 HEADING LASTNAME 'NAME' 83 HEADING YEARS-WORKED 'YRS' 84 AVG YEARS-WORKED RAISE 85 86 ** DEFINE EMPLOYEE SUMMARY REPORT 87 * 88 REPORT SUMMARY-REPORT SUMMARY 89 SEQUENCE WORKDEPT 90 CONTROL WORKDEPT 91 TITLE 1 'DEPARTMENT SUMMARY REPORT' 92 LINE WORKDEPT TALLY SALARY BONUS COMM YEARS-WORKED RAISE 93 HEADING WORKDEPT 'DEPT' 'CODE' 94 HEADING TALLY 'EMPLOYEE' 'COUNT' 95 HEADING YEARS-WORKED 'AVG' 'YRS' 96 HEADING RAISE 'AVG' 'RAISE' 97 AVG YEARS-WORKED RAISE

Page 13: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

9

This script reads an employee VSAM dataset named EMPVSAM that contains various employee-related fields. Record fields and work fields are defined. Raises are calculated for each employee, and a log file is printed. A detail report, below, and a summary report are also created.

03/03/2020 EMPLOYEE DETAIL REPORT PAGE 1

DEPT NAME SALARY BONUS COMM YRS RAISE A00 HAAS 305634.48 9102.00 4220.00 46 5 LUCCHESI 269424.05 4202.00 3720.00 53 10 O'CONNELL 169515.15 3902.00 2340.00 48 5 ==== ============= =========== =========== =========== ==== ==== A00 744573.68 17206.00 10280.00 49 6 B01 THOMPSON 43417.50 4102.00 3300.00 38 15 ==== ============= =========== =========== =========== ==== ==== B01 43417.50 4102.00 3300.00 38 15 C01 KWAN 40267.50 4102.00 3060.00 36 15 NICHOLLS 29946.00 3902.00 2274.00 35 5 QUINTANA 25095.00 3802.00 1904.00 40 5 ==== ============= =========== =========== =========== ==== ==== C01 95308.50 11806.00 7238.00 37 8 D11 ADAMSON 47857.78 3802.00 2022.00 39 10 BROWN 52496.45 3902.00 2217.00 45 10 JONES 34639.40 3702.00 1462.00 32 10 LUTZ 56456.32 3902.00 2387.00 43 10 SCOUTTEN 40428.29 3802.00 1707.00 38 10 STERN 61000.78 3902.00 2580.00 38 15 WALKER 38750.10 3702.00 1636.00 37 10 YOSHIMURA 46726.40 3802.00 1974.00 33 10 ==== ============= =========== =========== =========== ==== ==== D11 420499.81 34218.00 17765.00 37 10 D21 JEFFERSON 88544.85 3702.00 1774.00 45 5 JOHNSON 6983.12 3602.00 1380.00 36 5 MARINO 114781.75 3902.00 2301.00 32 5 PEREZ 109279.19 3802.00 2190.00 31 5 PULASKI 144328.18 4002.00 2893.00 31 15 SMITH 76582.75 8702.00 1534.00 42 5 ==== ============= =========== =========== =========== ==== ==== D21 540499.84 27712.00 12072.00 36 6 E01 GEYER 42288.75 4102.00 3214.00 62 20 ==== ============= =========== =========== =========== ==== ==== E01 42288.75 4102.00 3214.00 62 20 E21 GOUNOT 25137.00 3802.00 1907.00 64 10 LEE 26743.50 3802.00 2030.00 35 5 MEHTA 21052.50 3702.00 1596.00 46 5 SPENSER 27562.50 3802.00 2092.00 31 15 ==== ============= =========== =========== =========== ==== ==== E21 100495.50 15108.00 7625.00 44 8 ==== ============= =========== =========== =========== ==== ==== 1987083.58 114254.00 61494.00 40 9

Page 14: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

10

The summary report below contains only summary (subtotals) lines and the final totals line from the detail report—no detail lines are printed. The last line contains sums for all but the last two fields, which were specified by the AVG command. The TALLY predefined field is used in this report to show employee counts per department.

The resulting log file appears below.

RAISE FOR CHRISTINE HAAS IS 5% RAISE FOR MICHAEL THOMPSON IS 15% RAISE FOR SALLY KWAN IS 15% RAISE FOR JOHN GEYER IS 20% RAISE FOR IRVING STERN IS 15% RAISE FOR EVA PULASKI IS 15% NO RAISE FOR EILEEN HENDERSON RAISE FOR THEODORE SPENSER IS 15% RAISE FOR VINCENZO LUCCHESI IS 10% RAISE FOR SEAN O'CONNELL IS 5% RAISE FOR DOLORES QUINTANA IS 5% RAISE FOR HEATHER NICHOLLS IS 5% RAISE FOR BRUCE ADAMSON IS 10% RAISE FOR ELIZABETH PIANKA IS 10% RAISE FOR MASATOSHI YOSHIMURA IS 10% RAISE FOR MARILYN SCOUTTEN IS 10% RAISE FOR JAMES WALKER IS 10% RAISE FOR DAVID BROWN IS 10% RAISE FOR WILLIAM JONES IS 10% RAISE FOR JENNIFER LUTZ IS 10% RAISE FOR JAMES JEFFERSON IS 5% RAISE FOR SALVATORE MARINO IS 5% RAISE FOR DANIEL SMITH IS 5% RAISE FOR SYBIL JOHNSON IS 5% RAISE FOR MARIA PEREZ IS 5% NO RAISE FOR ETHEL SCHNEIDER NO RAISE FOR JOHN PARKER NO RAISE FOR PHILIP SMITH NO RAISE FOR MAUDE SETRIGHT RAISE FOR RAMLAL MEHTA IS 5% RAISE FOR WING LEE IS 5% RAISE FOR JASON GOUNOT IS 10%

03/03/2020 DEPARTMENT SUMMARY REPORT PAGE 1

DEPT EMPLOYEE SALARY BONUS COMM AVG AVG CODE COUNT YRS RAISE A00 3 744573.68 17206.00 10280.00 49 6 B01 1 43417.50 4102.00 3300.00 38 15 C01 3 95308.50 11806.00 7238.00 37 8 D11 8 420499.81 34218.00 17765.00 37 10 D21 6 540499.84 27712.00 12072.00 36 6 E01 1 42288.75 4102.00 3214.00 62 20 E21 4 100495.50 15108.00 7625.00 44 8 ==== ======== =========== =========== =========== ==== ===== 26 1987083.58 114254.00 61494.00 40 9

Page 15: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

11

Many Keywords/Functions Are Common Review the list below to see a sample of keywords/functions common to both DATAMINER and CA EASYTRIEVE. Many of the commands are discussed further in this document. For details, refer to the User Reference & Installation Notes manual.

Keyword Description

CALL Call an external load module.

CASE Control conditional flow.

COPY Copy field definitions from one file to another.

DEFINE Define record fields and user variables.

DISPLAY Write data to system printer or a specified file.

DO WHILE Handle loop processing.

ELSE Control conditional flow.

ELSE-IF Control conditional flow.

ENDCASE Control conditional flow.

END-IF Control conditional flow.

END-DO Control conditional flow.

FILE Define an input or output file. DATAMINER has its own INPUT and OUTPUT commands but supports the FILE statement. DATAMINER supports sequential and VSAM file types, DB2 databases, and PUNCH output. Other databases and/or access methods can be handled via the EXIT parameter and a user-written exit program.

GET Read the next sequential record.

GOTO Allow the execution to branch to a label.

IF Control conditional flow.

JOB Defines the activity. This can control which file(s) are read and how they are processed.

MACRO Defines the macro prototype.

MEND End of in-stream macro definition.

MOVE Move data (with padding) from one field to another.

MOVE LIKE Move like fields from one file record to another.

Page 16: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

12

Keyword Description

MSTART Start of in-stream macro definition.

PARM Set environment options; DATAMINER has its own OPTION command but supports PARM statements.

PARM-DATA Pass data into DATAMINER using the EXEC statement’s PARM operand.

PERFORM Call a procedure somewhere in the script.

POINT Position a VSAM file.

PRINT Used with REPORT command to create reports.

PROC Define a procedure.

PUT Write a record to a sequential or VSAM file.

READ Read a record from a sequential or VSAM file.

REPORT Define a report (used in conjunction with PRINT).

SEARCH DATAMINER’s native method to access table data is FIND, but the SEARCH statement is supported.

SET Assign a record field or user variable a value.

SORT Sort an input file into an output file.

STOP Stop the execution of the script.

WHEN Control conditional flow.

WRITE Write a record to a sequential or a VSAM file.

Page 17: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

13

Sorting Files As stated earlier, DATAMINER has its own SORT command syntax. The example below, however, shows how you could use DATAMINER to sort a file using CA EASYTRIEVE syntax. The VSAM input EMPVSAM employee file is sorted into the sequential output EMPSORT file. The records are sorted into ascending order by salary. This example works for either DATAMINER or CA EASYTRIEVE.

FILE EMPVSAM VS SALARY 73 5 P 2 FILE EMPSORT FB(100 1000) SORT EMPVSAM TO EMPSORT USING SALARY

A second example shows how to tell DATAMINER to select only certain records to include in the output SORT file. In this example, only employees with a salary greater than or equal to 50,000 are placed into the SORT output file. This differs from the CA EASYTRIEVE method of using the “BEFORE procname” operands to call a procedure to include only certain records in the output sort file.

SORT EMPVSAM TO EMPSORT USING SALARY DURING INPUT SKIP SALARY < 50000

DATAMINER also supports the CA EASYTRIEVE method of filtering records. The following example produces the same results as the previous example.

SORT EMPVSAM TO EMPSORT USING SALARY BEFORE SALCHECK * SALCHECK. PROC IF SALARY >= 50000 SELECT ENDIF END-PROC

Page 18: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

14

Data Manipulation DATAMINER and CA EASYTRIEVE assign values to fields in the same way. The optional DATAMINER SET command is equivalent to the EASYTRIEVE assignment statement. For example, each allows and processes the following statements in the same fashion:

SALARY = 50000 /* Set salary to 50000 JOBTITLE = 'MANAGER' /* Set job title to MANAGER

DATAMINER and CA EASYTRIEVE handle arithmetic expressions in the same way. For example, each allows and processes the following statements in the same fashion:

* Calculate total compensation TOT-COMPENSATION = SALARY + BONUS + COMMISSION * Increase compensation by 10% NEW-COMPENSATION = TOT-COMPENSATION * 1.10

DATAMINER and CA EASYTRIEVE can both assign the results of bitwise operations using AND, OR, and XOR to a user variable.

Field Assignments

Arithmetic Expressions

Page 19: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

15

Decision and Branching Logic IF, ELSE, ELSE-IF, and END-IF statements are supported the same as CA EASYTRIEVE, including multiple conditions (using AND or OR connectors) and arithmetic expressions. DATAMINER supports all relational conditions you are familiar with in CA EASYTRIEVE, including EQ, =, NE, !=, LT, <, LE, <=, GT, >, GE, and >=. In addition, DATAMINER supports the bitwise relational operators ON and OFF. IF SALARY < 50000 BONUS = 5000 ELSE BONUS = 10000 END-IF

CASE, WHEN, and ENDCASE are supported. CASE chooses from a sequence of conditions and executes the corresponding statement(s).

CASE DEPT WHEN '1' DISPLAY 'DEPARTMENT IS SALES' WHEN '2' DISPLAY 'DEPARTMENT IS MARKETING' WHEN '3' DISPLAY 'DEPARTMENT IS ACCOUNTING' OTHERWISE DISPLAY 'DEPARTMENT IS EXECUTIVE' ENDCASE

DO WHILE and END-DO statements are supported. The example below produces the same output for either DATAMINER or CA EASYTRIEVE. The employee file is read until EOF is detected, writing out a few details about each employee. DATAMINER processes the JOB and STOP statements, but this example does not require them.

JOB INPUT NULL GET EMPVSAM DO WHILE (FILE-STATUS != 'EOF') DISPLAY EMPNO WORKDEPT LASTNAME SALARY GET EMPVSAM END-DO STOP

The GOTO statement and corresponding label are supported. The example below produces the same results as the previous example, but this time using GOTO and a label. GET EMPVSAM READLOOP. IF (FILE-STATUS != 'EOF') DISPLAY EMPNO WORKDEPT LASTNAME SALARY GET EMPVSAM GOTO READLOOP END-IF

IF, ELSE, ELSE-IF, and END-IF Statements

CASE, WHEN, and ENDCASE Statements

DO WHILE and END-DO Statements

GOTO Statements and Labels

Page 20: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

16

DATAMINER procedures are defined and called identically to CA EASYTRIEVE procedures. They are defined with the PROC and END-PROC commands and are called with the PERFORM command.

DATAMINER also supports seven specially named REPORT procedures. Commands placed within one of these procedures execute automatically at a prescribed point during report processing. For example, you can use the BEFORE-INPUT procedure to limit or filter input records to the report. These procedures provide additional control over the printed output.

Procedures

Page 21: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

17

Input and Output DATAMINER provides for both automatic and script-controlled I/O. DATAMINER’s shortcut commands place the script into automatic I/O mode where the script itself does not need to read each input record. DATAMINER automatically loops through the script and reads each record. These commands include COPY, UPDATE, EXTRACT, PRINT, DUMP, and DELETE.

The DATAMINER AUTO command also places the script into automatic I/O mode and is especially useful in Report Writer scripts. The simulated JOB statement (excluding the INPUT NULL option) also places a script into automatic I/O mode.

The script can optionally perform its own I/O using, for example, the READ (or GET) and WRITE (or PUT) commands. Script looping can be controlled manually with a WHILE condition statement.

Page 22: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

18

TABLE Processing DATAMINER has its own TABLE definition command and corresponding FIND command, but DATAMINER supports the CA EASYTRIEVE method of defining a table with the FILE statement and accessing the table through the SEARCH statement. DATAMINER supports loading a table either from a file or directly in the script input cards.

DATAMINER can process the following program directly with no changes.

DEFINE DAY-OF-WEEK 1 C DEFINE NAME-OF-DAY 9 C FILE WEEKDAY TABLE INSTREAM ARG 1 1 C DESC 3 9 C 1 SUNDAY 2 MONDAY 3 TUESDAY 4 WEDNESDAY 5 THURSDAY 6 FRIDAY 7 SATURDAY ENDDATA DAY-OF-WEEK = '3' SEARCH WEEKDAY WITH DAY-OF-WEEK + GIVING NAME-OF-DAY DISPLAY WEEKDAY:FILE-STATUS DAY-OF-WEEK NAME-OF-DAY

Page 23: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

19

Macro Processing DATAMINER supports macro statements the same as CA EASYTRIEVE. The in-line macro statements are MSTART, MACRO, and MEND. Macros can also be stored and retrieved from macro libraries. DATAMINER processes macro invocations and parameter substitutions the same as CA EASYTRIEVE.

The following example shows how to define an in-line macro and also how to invoke it.

MSTART SQUARE MACRO 2 NUMBER RESULT PUSH LIST OFF DEFINE SQUARE_NUMBER S 6 N VALUE 000000 SQUARE_NUMBER = &NUMBER * &NUMBER &RESULT = SQUARE_NUMBER POP MEND * JOB INPUT NULL DEFINE SQUARED_RESULT W 6 N VALUE 000000 %SQUARE 4 SQUARED_RESULT DISPLAY 'SQUARED_RESULT' SQUARED_RESULT

Page 24: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

20

Listing Control Statements The following statements control the printing of the script/program statements and macros. All CA EASYTRIEVE operands are supported.

Statement Description

LIST Controls whether the source program statements/macros are printed or suppressed.

NEWPAGE Skips to top of page before printing the next source statement.

SKIP Skips the specified number of lines before printing the next source statement.

PUSH Saves the current listing control indicators.

POP Restores the previous listing control indicators.

Page 25: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

21

Virtual File Support DATAMINER uses its Virtual File Manager (VFM) to manage virtual files the same as CA EASYTRIEVE. You use the VIRTUAL parameter on the FILE statement to indicate a virtual file. The VFM facility provides a convenient way to allocate temporary sequential files.

The DATAMINER VFM can be configured through an option in the global options table or by an OPTION command parameter (in a single script) to use either 64-bit storage or dataspaces, depending on your operating system.

Page 26: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

22

DB2 Database Processing DATAMINER provides a native DB2 interface. It uses a dynamic SQL interface, so your script does not require a precompile or BIND. Refer to the DATAMINER User Reference & Installation Notes for details on the easy-to-use native DB2 interface. DATAMINER is also compatible with many EASYTRIEVE automatic retrieval methods.

The following three examples access a DB2 employee table. DATAMINER can process these programs directly with no changes.

JOB INPUT SQL SELECT * FROM EMPLOYEE DISPLAY EMPNO WORKDEPT LASTNAME SALARY BONUS COMM FILE GETSQL SQL(SELECT * FROM EMPLOYEE) JOB INPUT GETSQL DISPLAY EMPNO WORKDEPT LASTNAME SALARY BONUS COMM FILE GETSQL SQL JOB INPUT GETSQL SELECT * FROM EMPLOYEE DISPLAY EMPNO WORKDEPT LASTNAME SALARY BONUS COMM

Page 27: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

23

Simple Reports The DISPLAY command works as it does in CA EASYTRIEVE. DISPLAY is used to write output to the system printer or other sequential file. The HEX operand is not supported; however, DATAMINER provides the SHOW command to write hexadecimal fields or records.

The PRINT command can be used in conjunction with the SELECT command to create basic, non-sorted reports. The PRINT command is also used in conjunction with the REPORT command to generate more complex reports that can be sorted, summarized, and controlled very similarly to CA EASYTRIEVE reports.

Page 28: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

24

Report Writer DATAMINER handles report processing the same way that CA EASYTRIEVE does. Reports are defined with the REPORT command, and most common operands and subcommands are supported. The “PRINT report_name” command, in conjunction with the “REPORT report_name” command, is used in the same fashion. DATAMINER can also produce basic, non-sorted reports with the PRINT and SELECT commands.

Some DATAMINER operands and subcommands differ in name from CA EASYTRIEVE, but in most cases the corresponding CA EASYTRIEVE syntax is also supported.

All the report operands and subcommands for both DATAMINER and CA EASYTRIEVE are listed below. For more information, see chapter 11, “Report Writer,” in the DATAMINER User Reference & Installation Notes.

DATAMINER supports the following REPORT operands.

Operand Description

ACROSS Enables N-up printing for labels and specifies the number of labels to print across the page.

ADVANCE Specifies the number of lines to skip after a summary line is printed.

DOWN Supported EASYTRIEVE synonym for the DATAMINER HEIGHT operand.

DTLCTL Controls detail-line printing. The EVERY, FIRST, and NONE operands are supported.

EVERY Supported EASYTRIEVE synonym for the DATAMINER FREQ operand.

FREQ Specifies to skip all but every nth PRINT command for this report; limits printing for testing.

GAP Specifies the number of blank columns between report fields for centered and left-aligned report layouts.

HEIGHT Specifies the number of lines allocated for each label.

LABELS Specifies to print pages in labels format—suppresses the date, page titles, page numbers, and field headings.

LENGTH Specifies the maximum number of lines per page.

LIMIT Specifies the maximum number of report lines to print for testing.

Overview

REPORT Operands

Page 29: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

25

Operand Description

LINESIZE Specifies the length of report lines, or the highest column number.

NOADJUST Specifies to not center the report. Report fields are left aligned—the first field starts in column one.

NODATE Specifies to not print the date string in the leftmost ten columns on the first line.

NOHDRS Specifies to not print the field-heading line.

NOHEADING Supported EASYTRIEVE synonym for the DATAMINER NOHDRS operand.

NOPAGE Specifies to not print the page number string in the rightmost ten columns on the first line.

NOSPREAD Specifies to not spread report fields equally across the print line when the default layout is set to SPREAD.

PAGESIZE Supported EASYTRIEVE synonym for the DATAMINER LENGTH operand.

PRINTER Specifies a printer file defined by an OUTPUT= command (the default is the system printer).

SIZE Supported EASYTRIEVE synonym for the DATAMINER WIDTH operand.

SKIP Supported EASYTRIEVE synonym for the DATAMINER ADVANCE operand.

SPACE Supported EASYTRIEVE synonym for the DATAMINER GAP operand.

SPACING Specifies single, double, or triple line spacing (DATAMINER only).

SPREAD Specifies to spread report fields equally across the print line when SPREAD is not the default layout.

SUMCTL Controls summary-line printing. ALL, HIAR, NONE, TAG, and DTLCOPY operands are supported.

SUMMARY Specifies to limit a report to listing only the summary (subtotals) lines at each break and the final totals line.

SUMSPACE Specifies the number of additional columns to print to add space for summary fields.

TALLYSIZE Sets the number of digits printed for the TALLY field.

WIDTH Specifies the number of columns for each label.

Page 30: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

26

DATAMINER supports the following REPORT subcommands.

Subcommand Description

AVG Specifies the fields for which you want summary averages calculated and printed at each break. CA EASYTRIEVE requires that you to create a BEFORE-BREAK report procedure to do this.

BREAK Specifies the fields (data objects) that control when to break the report to print subtotals or averages.

CONTROL Supported CA EASYTRIEVE synonym for the DATAMINER BREAK subcommand.

HEADING Defines up to three heading lines, stacked, for a specified field.

LINE Selects the fields to print on one of up to 255 lines for each execution of “PRINT report_name.” The syntax is identical to CA EASYTRIEVE’s. The lines defined by one or more LINE statements make up what is known as a subpage.

ORDER Specifies the order in which you want report fields sorted. Any number of fields, sorted individually in ascending or descending order, can be specified.

SEQUENCE Supported CA EASYTRIEVE synonym for the DATAMINER ORDER subcommand.

SUM Specifies the fields for which you want summary values printed at each break when subtotals are not printed by default. DATAMINER determines whether to print subtotals for a field by default based on its definition. If SUM is used, only the fields specified by SUM have subtotals and a final total in the report.

TITLE Specifies up to eight title lines for the report. The syntax is identical to CA EASYTRIEVE’s syntax.

If you code these specially named procedures after a REPORT command, DATAMINER calls them automatically during report processing. Each procedure is called at a different point in the report-processing cycle.

Procedure Name Description

REPORT-INPUT Called for each PRINT report statement. Can be used to include/exclude input records and/or alter report input data.

REPORT Subcommands

REPORT Procedures

Page 31: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

27

Procedure Name Description

BEFORE-LINE Called before printing detail lines. Can be used to augment the detail line.

AFTER-LINE Called after printing detail lines. Can be used to augment the detail line.

BEFORE-BREAK Called before the summary line is printed. Can be used to calculate percentages and averages.

AFTER-BREAK Called after the summary line is printed. Can be used to augment the summary line.

ENDPAGE Called when the end of page is detected. Can be used to add page footer information.

TERMINATION Called at the end of the report. Can be used to report footer information.

DATAMINER supports the following system variables used with the REPORT command.

Variable Description

BREAK-LEVEL A 2-byte binary field that contains the highest control (break) level. BREAK-LEVEL is used in REPORT procedures.

LEVEL A 2-byte binary field that contains the current control (break) level. LEVEL is used in REPORT procedures.

LINE-NUMBER Holds the number of the line being processed since the last break in a Report Writer report. This variable can be used in a BEFORE-LINE or an AFTER-LINE procedure.

TALLY Holds a tally of detail lines in the report. If included in a report, a subtotal is printed at each break, and the total count is printed on the final-totals line. You can specify TALLY as an operand to the LINE subcommand, and you can define a custom heading for the TALLY field in a report using the HEADING subcommand.

REPORT System Variables

Page 32: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

28

Creating a Formatted Report You use the following steps to create a custom report with DATAMINER’s Report Writer.

1. Specify the input data for the report.

2. Define the record fields and variables you want to use.

3. Specify how to read the input file.

4. Optionally select the records to process.

5. Optionally perform data computations.

6. Specify the report name to print.

7. Specify the report’s format using REPORT subcommands.

8. Optionally define a procedure to customize report lines.

Each of these steps is explained below.

Specify the report’s input using the INPUT= command. Use one or more INPUT= commands to tell DATAMINER which data sources to read for the report. You can use the command’s MAX=records operand to limit the input to a small number of records while testing your report.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes CA EASYTRIEVE’s FILE statements as though they were native DATAMINER INPUT statements.

You can define all the record fields that are in each data source or only the record fields needed for the report. You must define any user variables you need as well. User variables hold information that you can manipulate before DATAMINER writes values to a report line.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes all record fields and user variables defined in EASYTRIEVE as though they had been defined in DATAMINER.

If only one data source is required, you can use the AUTO command to put DATAMINER into auto-read mode. An alternative method is to manage record reading manually by using a READ command within a loop (such as a DO WHILE loop) to perform each read. DATAMINER processes its own and EASYTRIEVE’s READ statements exactly the same way.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes CA EASYTRIEVE’s JOB statements as though they were native DATAMINER AUTO statements.

Overview

Step 1—Specify the Input File

Step 2—Define the Record Fields and Variables to Use

Step 3—Specify How to Read Input Records

Page 33: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

29

You can use different methods to limit the data written to a report. A common one is to wrap the PRINT command in an IF statement to control which records are input to the report. You can also use record-selection commands.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes its own and CA EASYTRIEVE’s IF statements exactly the same way.

You can use data-manipulation commands to perform any number of computations before writing a line to the report. You can define user variables to hold computed values, and the variables are passed to the report.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes its own and CA EASYTRIEVE’s variables and arithmetic statements exactly the same way.

Use a PRINT report-name statement to specify the report to which each line is written. The report name is defined by the REPORT command, which you typically place after the PRINT statement in a script. All record field names and variables are available to the report. A PRINT statement writes one or more lines to the report only if the statement is executed. If the statement is bypassed by some flow-control logic, such as in an IF statement, no write is performed. You can include multiple PRINT statements in a script to print multiple reports.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes its own and CA EASYTRIEVE’s PRINT statements exactly the same way.

Use the REPORT command to define a report. The REPORT command must be followed by at least one LINE subcommand, which specifies the record fields or other objects you want to print on a report line. Each LINE subcommand defines a separate line that is printed each time the PRINT command executes. You can use multiple LINE subcommands if you want to print different objects on different lines, as you may need to do if you print labels.

You control the report’s format by adding REPORT subcommands. For example, the TITLE subcommand specifies a report title, and the HEADING subcommand specifies a custom heading for a field.

The section “Designing a Report’s Format” explains how you can create increasingly complex reports by adding subcommands to a report’s definition.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes its own and CA EASYTRIEVE’s REPORT statements exactly the same way.

Step 4—Optionally Select Records

Step 5—Optionally Perform Computations

Step 6—Use PRINT to Print a Report

Step 7—Use REPORT Subcommands to Define the Format

Page 34: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

30

Report Writer procedures allow you to customize a report by printing additional lines or text within the report. You define a Report Writer procedure by using the PROC command and assigning one of seven special procedure names. DATAMINER calls a Report Writer procedure automatically at a specific point, indicated by the name, when the report is processed and lines are printed to the output. You place the procedure definition after the report definition.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER processes its own and CA EASYTRIEVE’s procedure statements exactly the same way.

Step 8—Optionally Define a Report Writer Procedure

Page 35: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

31

Report Writer Script Example The following script example highlights the steps to creating a report.

<Execution JCL goes here> INPUT=DISK FILENAME=SALES ********************************************* CUST-NO 1 8 C HEADING ('CUSTOMER' 'NUMBER') DEPT 64 12 C HEADING ('SALES' 'DEPARTMENT') VALUE 90 9 P 2 DEFINE DISC-VAL 9 P 2 HEADING 'DISCOUNTED' 'VALUE' ********************************************* AUTO INPUT SALES ********************************************* * Wrap the PRINT command in an IF statement * to select records for printing IF CUST-NO >= 50000000 DISC-VAL = VALUE SUBTRACT DISCOUNT FROM DISC-VAL PRINT SALES-REPORT ENDIF ********************************************* REPORT SALES-REPORT TITLE "DEPARTMENTAL SALES REPORT" "WITH DISCOUNTS" LINE DEPT CUST-NO VALUE DISCOUNT DISC-VAL ORDER DEPT BREAK DEPT PROC BEFORE-BREAK IF LEVEL = 1 /* Processing DEPT break DISPLAY '***' DISPLAY '*** TOTAL FOR DEPARTMENT:' DEPT 'EMPLOYEE COUNT:' TALLY DISPLAY '***' ENDIF ENDPROC /*

1. Define the input file. 2. Define record fields in the input file.

If needed, define a user variable for a calculation. As an option, add custom field headings to these object definitions, or use the HEADING subcommand under the REPORT command below.

3. Set up automatic reading of the input file. As an option, use a manual READ loop instead of the AUTO command.

4. Add record-selection logic (optional).

5. Perform a computation (optional).

6. Print the report name defined by the REPORT command below.

7. Define the report name and format,

letting DATAMINER do most of the work. Use REPORT subcommands, placing them after the REPORT command.

8. Define a Report Writer procedure to print custom lines to the report (optional).

Page 36: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

32

Designing a Report’s Format A report can be constructed very simply. It can be designed to print one line for each input record in the order that the record is read. Or it can be sorted and summarized by particular field names. Many reports can be generated from a single script, and many input files can be read.

The examples below start with a simple Report Writer script and build upon it. The formatting subcommands added to subsequent script examples are double underscored.

Notice the MAX=15 on the INPUT= command in Report Example 1. The examples in this section limit the reports to only 15 input records. (These definitions are not shown in the subsequent examples.)

This is a simple auto-mode script that writes each record read in from an employee VSAM file to the report. The report is defined with one line for each employee, printed in the order in which each record is read.

INPUT=VSAM FILENAME=EMPVSAM MAX=15 EMPNO 1,6,C LASTNAME 22,13,C DEPT 35,3,C SALARY 73,5,P,2 /* Decimal places (2) are specified for BONUS 78,5,P,2 /* these numeric objects, so DataMiner COMM 83,5,P,2 /* auto-sums their values & prints the * /* sums on the final totals line. AUTO EMPVSAM /* Auto-read records PRINT EMPRPT /* Write a line to the report REPORT EMPRPT LINE 1 DEPT EMPNO LASTNAME SALARY BONUS COMM

Here is the resulting report. Each field name is used as a field heading.

Report Example 1

03/03/2020 PAGE 1

DEPT EMPNO LASTNAME SALARY BONUS COMM D11 000170 YOSHIMURA 46726.40 3802.00 1974.00 D11 000160 PIANKA 42144.29 3702.00 1780.00 D11 000150 ADAMSON 47857.78 3802.00 2022.00 C01 000140 NICHOLLS 29946.00 3902.00 2274.00 C01 000130 QUINTANA 25095.00 3802.00 1904.00 A00 000120 O'CONNELL 169515.15 3902.00 2340.00 A00 000110 LUCCHESI 269424.05 4202.00 3720.00 E21 000100 SPENSER 27562.50 3802.00 2092.00 E11 000090 HENDERSON 31342.50 3902.00 2380.00 D21 000070 PULASKI 144328.18 4002.00 2893.00 E01 000050 GEYER 42288.75 4102.00 3214.00 D11 000060 STERN 61000.78 3902.00 2580.00 C01 000030 KWAN 40267.50 4102.00 3060.00 B01 000020 THOMPSON 43417.50 4102.00 3300.00 A00 000010 HAAS 305634.48 9102.00 4220.00 === ====== ============= =========== =========== =========== 1265606.02 64130.00 39753.00

Page 37: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

33

This script generates the same report output as Report Example 1. It is a manual-mode script, however, which means that it uses a loop (here, a DO WHILE loop) instead of AUTO to manage reading input records.

READ EMPVSAM DO WHILE (EMPVSAM:IO-RESULT = 'OK ') PRINT EMPRPT READ EMPVSAM ENDDO * Define the report REPORT EMPRPT LINE 1 DEPT EMPNO LASTNAME SALARY BONUS COMM

The script in this example uses the AUTO command to manage reading input records. AUTO is also used in the subsequent report examples.

The resulting report includes a title on line 1, and the detail lines are sorted by department number.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER’s ORDER subcommand is used in this and the following examples, but DATAMINER processes SEQUENCE statements in CA EASYTRIEVE programs the same as native ORDER statements.

AUTO EMPVSAM /* This is an auto-mode script PRINT EMPRPT /* Write a line to report * Define the report REPORT EMPRPT TITLE 1 'EMPLOYEE LIST' /* Print title string on line 1 ORDER DEPT /* Order by department LINE 1 DEPT EMPNO LASTNAME SALARY BONUS COMM

Here is the resulting report:

Report Example 2

Report Example 3

03/03/2020 EMPLOYEE LIST PAGE 1

DEPT EMPNO LASTNAME SALARY BONUS COMM A00 000110 LUCCHESI 269424.05 4202.00 3720.00 A00 000120 O'CONNELL 169515.15 3902.00 2340.00 A00 000010 HAAS 305634.48 9102.00 4220.00 B01 000020 THOMPSON 43417.50 4102.00 3300.00 C01 000130 QUINTANA 25095.00 3802.00 1904.00 C01 000140 NICHOLLS 29946.00 3902.00 2274.00 C01 000030 KWAN 40267.50 4102.00 3060.00 D11 000170 YOSHIMURA 46726.40 3802.00 1974.00 D11 000160 PIANKA 42144.29 3702.00 1780.00 D11 000060 STERN 61000.78 3902.00 2580.00 D11 000150 ADAMSON 47857.78 3802.00 2022.00 D21 000070 PULASKI 144328.18 4002.00 2893.00 E01 000050 GEYER 42288.75 4102.00 3214.00 E11 000090 HENDERSON 31342.50 3902.00 2380.00 E21 000100 SPENSER 27562.50 3802.00 2092.00 === ====== ============= =========== =========== =========== 1326550.86 64130.00 39753.00

Page 38: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

34

In the following example, adding the BREAK subcommand and specifying the DEPT object as its argument organizes the report by department. That is, when the value of DEPT changes, DATAMINER inserts a section break in the report. Each department now displays a summary (subtotals) line. By default, DATAMINER prints separator characters (==) above each summary line.

Are You Replacing CA EASYTRIEVE with DATAMINER? DATAMINER’s BREAK subcommand is used in this and the following examples; however, DATAMINER processes CONTROL statements in existing CA EASYTRIEVE programs as though they were native DATAMINER BREAK statements.

AUTO EMPVSAM /* This is an auto-mode script PRINT EMPRPT /* Write a line to the report * Define the report REPORT EMPRPT TITLE 1 'EMPLOYEE LIST' ORDER DEPT /* Order lines by department BREAK DEPT /* Organize report by department LINE 1 DEPT EMPNO LASTNAME SALARY BONUS COMM

Here is the resulting report:

Report Example 4

03/03/2020 EMPLOYEE LIST PAGE 1

DEPT EMPNO LASTNAME SALARY BONUS COMM A00 000110 LUCCHESI 269424.05 4202.00 3720.00 000120 O'CONNELL 169515.15 3902.00 2340.00 000010 HAAS 305634.48 9102.00 4220.00 === ====== ============= =========== =========== =========== A00 744573.68 17206.00 10280.00 B01 000020 THOMPSON 43417.50 4102.00 3300.00 === ====== ============= =========== =========== =========== B01 43417.50 4102.00 3300.00 C01 000130 QUINTANA 25095.00 3802.00 1904.00 000140 NICHOLLS 29946.00 3902.00 2274.00 000030 KWAN 40267.50 4102.00 3060.00 === ====== ============= =========== =========== =========== C01 95308.50 11806.00 7238.00 D11 000170 YOSHIMURA 46726.40 3802.00 1974.00 000160 PIANKA 42144.29 3702.00 1780.00 000060 STERN 61000.78 3902.00 2580.00 000150 ADAMSON 47857.78 3802.00 2022.00 === ====== ============= =========== =========== =========== D11 197729.25 15208.00 8356.00

Page 39: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

35

Adding the NEWPAGE operand to BREAK in the following example forces a page break after each department summary is printed. The department number is added to a second TITLE command statement (for line 2), and the employees within each department are now sorted in descending order. DATAMINER centers the title strings over the report fields.

AUTO EMPVSAM /* This is an auto-mode script PRINT EMPRPT /* Write a line to the report * Define the report REPORT EMPRPT TITLE 1 'EMPLOYEE LIST' TITLE 2 'FOR DEPARTMENT' DEPT ORDER DEPT -SALARY /* Order by dept then by salary BREAK DEPT NEWPAGE /* Organize by department LINE 1 DEPT EMPNO LASTNAME SALARY BONUS COMM

Here is the resulting report:

Report Example 5

03/03/2020 EMPLOYEE LIST PAGE 1 FOR DEPARTMENT A00

DEPT EMPNO LASTNAME SALARY BONUS COMM A00 000010 HAAS 305634.48 9102.00 4220.00 000110 LUCCHESI 269424.05 4202.00 3720.00 000120 O'CONNELL 169515.15 3902.00 2340.00 === ====== ============= =========== =========== =========== A00 744573.68 17206.00 10280.00

03/03/2020 EMPLOYEE LIST PAGE 2 FOR DEPARTMENT B01

DEPT EMPNO LASTNAME SALARY BONUS COMM B01 000020 THOMPSON 43417.50 4102.00 3300.00 === ====== ============= =========== =========== =========== B01 43417.50 4102.00 3300.00

03/03/2020 EMPLOYEE LIST PAGE 3 FOR DEPARTMENT C01

DEPT EMPNO LASTNAME SALARY BONUS COMM C01 000030 KWAN 40267.50 4102.00 3060.00 000140 NICHOLLS 29946.00 3902.00 2274.00 000130 QUINTANA 25095.00 3802.00 1904.00 === ====== ============= =========== =========== =========== C01 95308.50 11806.00 7238.00

Page 40: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

36

In the script below, a user variable is added to calculate total compensation. First, TOTAL_COMP is defined. Then within the auto-read loop (that is, after the AUTO command), a total compensation value is calculated by adding salary, bonus, and commissions. This new variable is included in the report.

A separate summary report is also defined and organized by department, and it includes the employee count in each department. The TALLY system variable stores the count of detail lines (per department) and reflects the employee count. A summary report omits all detail lines.

* Define TOTAL_COMP user variable DEFINE TOTAL_COMP 5,P,2 HEADING 'TOTAL' 'COMPENSATION' AUTO EMPVSAM /* This is an auto-mode script TOTAL_COMP = SALARY + BONUS + COMM /* Calculate total pay PRINT EMPRPT /* Write line to detail report PRINT EMPSUM /* Write line to summary report * Define the detail report REPORT EMPRPT TITLE 1 'EMPLOYEE LIST' TITLE 2 'FOR DEPARTMENT' DEPT ORDER DEPT -SALARY /* Order by dept then salary BREAK DEPT NEWPAGE /* Organize rpt by department LINE 1 DEPT EMPNO LASTNAME TOTAL_COMP SALARY BONUS COMM * Define the summary report REPORT EMPSUM TITLE 1 'DEPARTMENT SUMMARY' ORDER DEPT /* Order by department only BREAK DEPT /* Organize rpt by department LINE 1 DEPT TOTAL_COMP SALARY BONUS COMM TALLY HEADING TALLY 'EMPLOYEE' 'COUNT' /* Set heading for TALLY SUMMARY /* Print summary lines only

Report Example 6

Page 41: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

37

Here is the resulting detail report:

Here is the resulting summary report:

03/03/2020 EMPLOYEE LIST PAGE 1 FOR DEPARTMENT A00

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION A00 000010 HAAS 318956.48 305634.48 9102.00 4220.00 000110 LUCCHESI 277346.05 269424.05 4202.00 3720.00 000120 O'CONNELL 175757.15 169515.15 3902.00 2340.00 === ====== ============= ============ =========== =========== =========== A00 772059.68 744573.68 17206.00 10280.00

03/03/2020 EMPLOYEE LIST PAGE 2 FOR DEPARTMENT B01

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION B01 000020 THOMPSON 50819.50 43417.50 4102.00 3300.00 === ====== ============= ============ =========== =========== =========== B01 50819.50 43417.50 4102.00 3300.00

03/03/2020 EMPLOYEE LIST PAGE 3 FOR DEPARTMENT C01

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION C01 000030 KWAN 47429.50 40267.50 4102.00 3060.00 000140 NICHOLLS 36122.00 29946.00 3902.00 2274.00 000130 QUINTANA 30801.00 25095.00 3802.00 1904.00 === ====== ============= ============ =========== =========== =========== C01 114352.50 95308.50 11806.00 7238.00

03/03/2020 DEPARTMENT SUMMARY PAGE 1

DEPT TOTAL SALARY BONUS COMM EMPLOYEE COMPENSATION COUNT A00 772059.68 744573.68 17206.00 10280.00 3 B01 50819.50 43417.50 4102.00 3300.00 1 C01 114352.50 95308.50 11806.00 7238.00 3 D11 221293.25 197729.25 15208.00 8356.00 4 D21 151223.18 144328.18 4002.00 2893.00 1 E01 49604.75 42288.75 4102.00 3214.00 1 E11 37624.50 31342.50 3902.00 2380.00 1 E21 33456.50 27562.50 3802.00 2092.00 1 === ============ =========== =========== =========== ======== 1430433.86 1326550.86 64130.00 39753.00 15

Page 42: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

38

Record selection is added to this example to restrict the report to only employees earning a salary of $50,000 or more.

The M5 standard mask is added to the total compensation variable, TOTAL_COMP, to print the leading dollar sign.

Finally, the AVG subcommand is added to both report definitions and specifies the numeric objects in those reports. As a result, DATAMINER prints the objects’ average values rather than their sums on the summary line.

* Define TOTAL_COMP variable DEFINE TOTAL_COMP 5,P,2 HEADING('TOTAL' 'COMPENSATION') M5 AUTO EMPVSAM IF SALARY >= 50000.00 /* Include only 50K+ employees TOTAL_COMP = SALARY + BONUS + COMM /* Calculate total pay PRINT EMPRPT /* Write line to detail report PRINT EMPSUM /* Write line to summary report ENDIF * Define the DETAIL report REPORT EMPRPT TITLE 1 '50K+ EMPLOYEE LIST' TITLE 2 'FOR DEPARTMENT' DEPT ORDER DEPT -SALARY /* Order by dept then salary BREAK DEPT NEWPAGE /* Organize rpt by department LINE 1 DEPT EMPNO LASTNAME TOTAL_COMP SALARY BONUS COMM AVG SALARY BONUS COMM TOTAL_COMP /* Print averages * Define the SUMMARY report REPORT EMPSUM TITLE 1 '50K+ EMPLOYEE LIST' TITLE 2 'DEPARTMENT SUMMARY' ORDER DEPT /* Order by department BREAK DEPT /* Organize by department LINE 1 DEPT TOTAL_COMP SALARY BONUS COMM TALLY HEADING TALLY 'EMPLOYEE' 'COUNT' AVG SALARY BONUS COMM TOTAL_COMP /* Print averages SUMMARY /* Print summary lines only

Report Example 7

Page 43: DATAMINER ASYTRIEVE Upgrade Guide ATA INER

Chapter 3 Feature Comparisons

39

Here is the resulting detail report:

Here is the resulting summary report:

03/03/2020 50K+ EMPLOYEE LIST PAGE 1 FOR DEPARTMENT A00

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION A00 000010 HAAS $318,956.48 305634.48 9102.00 4220.00 000110 LUCCHESI $277,346.05 269424.05 4202.00 3720.00 000120 O'CONNELL $175,757.15 169515.15 3902.00 2340.00 === ====== ============= ============ =========== =========== =========== A00 $257,353.22 248191.22 5735.33 3426.66

03/03/2020 50K+ EMPLOYEE LIST PAGE 2 FOR DEPARTMENT D11

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION D11 000060 STERN $67,482.78 61000.78 3902.00 2580.00 === ====== ============= ============ =========== =========== =========== D11 $67,482.78 61000.78 3902.00 2580.00

03/03/2020 50K+ EMPLOYEE LIST PAGE 3 FOR DEPARTMENT D21

DEPT EMPNO LASTNAME TOTAL SALARY BONUS COMM COMPENSATION D21 000070 PULASKI $151,223.18 144328.18 4002.00 2893.00 === ====== ============= ============ =========== =========== =========== D21 $151,223.18 144328.18 4002.00 2893.00

03/03/2017 50K+ EMPLOYEE LIST PAGE 1 DEPARTMENT SUMMARY

DEPT TOTAL SALARY BONUS COMM EMPLOYEE COMPENSATION COUNT A00 $257,353.22 248191.22 5735.33 3426.66 3 D11 $67,482.78 61000.78 3902.00 2580.00 1 D21 $151,223.18 144328.18 4002.00 2893.00 1 === ============ =========== =========== =========== ======== $198,153.12 189980.52 5022.00 3150.60 5