How to Read a File CICS

IDENTIFICATIO DIVISION.

PROGRAM-ID. AD12GM.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY FILE01.
COPY FILE02.
01 COMMAREA.
02 VARS PIC X(4).
01 REC1.
02 EID2 PIC X(4).
02 FILLER PIC X.
02 ENAME2 PIC X(10).
02 FILLER PIC X.
02 ESAL2 PIC 9(5).
02 FILLER PIC X(59).
77 LENG PIC S9(4) COMP.
PROCEDURE DIVISION.
MOVE LOW-VALUES TO FILEI.
MOVE LOW-VALUES TO FILE1I.
MOVE LOW-VALUES TO FILEO.
MOVE LOW-VALUES TO FILE1O.
EXEC CICS SEND
MAP(‘FILE1’)
MAPSET(‘FILE02’)
ERASE
END-EXEC.
PERFORM READ-PARA.
EXEC CICS SEND
MAP(‘FILE’)
MAPSET(‘FILE01’)
END-EXEC.
EXEC CICS RETURN END-EXEC.
STOP RUN.
READ-PARA.
EXEC CICS RECEIVE
MAP(‘FILE1’)
MAPSET(‘FILE02’)
END-EXEC.
MOVE EID1I TO EID2.
EXEC CICS READ
FILE(‘FILE001’)
INTO(REC1)
RIDFLD(EID2)
LENGTH(LENGTH OF REC1)
END-EXEC.
MOVE EID2 TO EIDO.
MOVE ENAME2 TO ENAMEO.
MOVE ESAL2 TO ESALO.

Keep Reading

Latest from the Blog

Ingesting Data from AWS S3 into Databricks with Auto Loader: Building a Medallion Architecture

In this blog post, we will explore efficient methods for ingesting data from Amazon S3 into Databricks using Auto Loader. Additionally, we will discuss how to perform data transformations and implement a Medallion architecture to improve the management and processing of large datasets. What is the Medallion Architecture? The Medallion architecture is a data modeling…

Exploring Databricks Unity Catalog – System Tables and Information _Schema: Use Cases

Databricks Unity Catalog offers a unified governance solution for managing structured data across the Databricks Lakehouse platform. It enables organizations to implement fine-grained access controls, auditing, and monitoring, enhancing data governance and compliance. Key functionalities include centralized metadata management, data discovery, dynamic reporting, and data lineage tracking, optimizing performance and collaboration.