Customers investigating the effort required to migrate Easytrieve Plus Report Generator OS/390 VSAM files often ask if we access DB2 tables. They also look for a relatively easy way to convert these reports to DB2 from current VSAM and flat files.
Easytrieve Plus Report Generator, release 6.4
The answer in both cases is yes, if Easytrieve Plus and its optional DB2 interface are licensed at the site. As always, we encourage users to upgrade to the most current releases.
The effort to convert the Easytrieve Plus programs will be no greater than the effort to convert any other language such as COBOL or Assembler, and depends on the program. A SELECT statement must be coded for each file to be converted.
Here is a sample of a program reading VSAM (could also be a flat file) automatically, following that are 2 possible scenarios of this program converted to access a DB2 table:
Original Program - using VSAM or flat file input:
FILE GRADES VS
STUDENT-ID 1 9 A
CLASS-CODE 10 5 A
GRADE 15 1 A
JOB INPUT GRADES
PRINT RPT1
REPORT RPT1
TITLE 'GRADE REPORT'
LINE STUDENT-ID CLASS-CODE GRADE
Same Program using DB2 as Input:
FILE GRADES SQL +
(SELECT * FROM GRADES INTO :STUDENT-ID, :CLASS-CODE, :GRADE)
STUDENT-ID 1 9 A
CLASS-CODE 10 5 A
GRADE 15 1 A
JOB INPUT GRADES
PRINT RPT1
REPORT RPT1
TITLE 'GRADE REPORT'
LINE STUDENT-ID CLASS-CODE GRADE
This is a very basic example and it assumes that the DB2 table is arranged the same way as the VSAM file.
Another possibility would be this program using DB2:
SQL INCLUDE FROM GRADES <------- this generates working storage
definitions with the same names as the DB2 columns
JOB INPUT SQL
SELECT * FROM GRADES INTO :STUDENT_ID, :CLASS_CODE, :GRADE
PRINT RPT1
REPORT RPT1
TITLE 'GRADE REPORT'
LINE STUDENT_ID CLASS_CODE GRADE