The simple Sample Application contains batch and online processing coded in the following languages:
• VSAM in batch and online program.Figure 3‑1 Simple App StructureFigure 3‑2 Simple App Component Architecture
Initial load of the VSAM file. This file is loaded from a QSAM file. This program produces a list of the customers stored in the VSAM customer file.
This job runs an IDCAMS utility in order to DELETE & DEFINE the VSAM customer file. This job runs an IDCAMS utility and REPRO the VSAM file into a QSAM which can be easily read and checked. This job runs the PGMMB02 batch program which contains data used to update the VSAM customer file.Listing 3‑1 MAPM000 - Simple App Main MenuListing 3‑2 MAPM003 - Customer ListListing 3‑3 MAPM001 - Customer Detailed InformationListing 3‑4 MAPM002 - Customer MaintenanceThis program receives – thru the communication area – a customer identification number. The program accesses the VSAM customer file in order to display the customer data when known.This program enables the maintainance of the VSAM customers file:PGMM002 receives an action code and, when needed, a customer identification number. The action to be performed is displayed on the screen (CREATE, UPDATE or DELETE).
• This program lists the customers stored in the VSAM file. A limited number of customers are displayed on each screen – the PF7 and PF8 keys give access to the previous and next pages. A non-blank character at the beginning of a customer's line gives access to the detailed customer information screen (see program PGMM001).This batch program reads a sequential file containing data to be stored in the VSAM file. For each record in the entry file, a VSAM record is created. The VSAM file must have been DELETED and DEFINED prior to executing this program. All data from the entry file is supposed to be valid: hence, no control is performed within this program.PGMMB01 reads all the customer record from the VSAM file and produces a report. An example of the report produced is included in this document.Each input sequential file record contains a three characters action code (ADD, UPD or DEL) and the customer data required when creating a new customer or updating an existing one. Each input line updates the VSAM customer file. Customer data from the sequential file is supposed to be valid so that no control is performed by the PGMMB02 batch program.Batch programs and utilities are used to populate, update and list the VSAM customer file that hosts the data managed within the application. Five jobs are delivered with the application. This chapter describes how they are used.
1. Step 1: VSAM file definitionFirst, define the VSAM customer file thru the IDCAMS utility using DELETE/DEFINE commands.
2. Step 2: VSAM file initial load
3. Step 3: VSAM file checkIDCAMS is used to REPRO the VSAM file into a sequential file which can easily be read in the z/OS environment.
4. Step 4: VSAM file reportBatch program PGMMB01 produces a list of the customers stored in the VSAM customer file.Figure 3‑3 VSAM Customers File Initial Load
1. Step 1: VSAM file updateBatch program PGMMB02 reads a sequential file containing updates to be performed on VSAM customers file. The input file is sorted by the IBM standard sort utility.
2. Step 2: VSAM file reportBatch program PGMMB02 is used again in order to check that the updates were correctly applied to the VSAM customers file.Figure 3‑4 VSAM File UpdateSimple Sample Application relies on only one VSAM main customer file. In order to keep the migration process as simple as possible, the data is stored in displayable formats (in COBOL syntax, this means that only "X" and "9" USAGE DISPLAY pictures are used).The VSAM customer file contains the following information:
Table 3‑1 VSAM Customer Fle Description This VSAM file is a Key Sequenced Data Set (KSDS) based on the customer's identification number. Each record contains 266 characters and the key is stored from position 1 to position 6.Listing 3‑5 VSAM Customer File COBOL DescriptionThe following report is produced by program PGMMB01 that lists the customers from the VSAM file (METAW00.VSAM.CUSTOMER) after the initial load.Listing 3‑6 Simple App Initial ReportListing 3‑7 Simple App Updated Customer File Report
1. Access your CICS environment and enter the Simple App main transaction code M000 to connect to the application.
2. The Main menu is displayed. Enter 000003 in the Customer identifier field and press the PF08 key to inquire on the customer.
1. From the Main menu enter 000003 in the Customer identifier field and press the PF06 key to update customer information.
2. In the update screen all data may be modified. The screen header shows the action UPDATE. Change the customer’s address and press ENTER.
3. Press PF12 to confirm the updates. A Maintenance OK message is displayed in the screen footer. To cancel your input, press PF03 in order to return to the Main menu.
1. From the Main menu, press PF04 to access the Customer List first page.
2.
1. From the Main menu press PF05, the following screen is displayed.Action is set to CREATE in the screen header and fields are unprotected.
Table 3‑2 Simple App CICS APIs Read previous record during a file browse; VSAM and data tables only.