---
title: "CICS Sample Program to Read a File"
description: "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 FILL..."
url: https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/
date: 2016-04-06
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2016/04/pexels-photo-6457584.jpeg?fit=1880%2C1253&ssl=1
categories: ["CICS"]
tags: ["CICS reading a File Sample Logic"]
type: post
lang: en
---

# CICS Sample Program to Read a File

## 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.

Related[CICS Sample Program to Write Header and Footer](https://srinimf.com/2016/04/06/cics-sample-code-for-header-and-footer/)

Keep Reading

- [CICS Sample Program to Write Header and Footer](https://srinimf.com/2016/04/06/cics-sample-code-for-header-and-footer/)DateApril 6, 2016
- [7 CICS Symbolic Map Field Extensions](https://srinimf.com/2021/12/13/8-cics-symbolic-map-field-extensions/)DateDecember 13, 2021
- [Sample CICS Program for real pseudo conversation](https://srinimf.com/2015/04/06/sample-cics-pseudo-conversational-program/)DateApril 6, 2015

### Latest from the Blog

[![How to Find Databricks Job Status, Owner, and Active Runs Fast](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/10/pexels-photo-30972899.jpeg?resize=800%2C600&ssl=1)](https://srinimf.com/2026/10/17/databricks-find-job-status/)

## [How to Find Databricks Job Status, Owner, and Active Runs Fast](https://srinimf.com/2026/10/17/databricks-find-job-status/)

Need to audit Databricks workflows? Step-by-step guide to tracking job creators, service principal run identities, and current execution status in Databricks.

October 17, 2026October 20, 2026

[![30 SQL Practice Queries with Solutions — Run Them Live](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/10/pexels-photo-5530473.jpeg?resize=800%2C600&ssl=1)](https://srinimf.com/2026/10/01/30-sql-practice-queries-with-solutions-run-them-live/)

## [30 SQL Practice Queries with Solutions — Run Them Live](https://srinimf.com/2026/10/01/30-sql-practice-queries-with-solutions-run-them-live/)

Practice 30 SQL queries with solutions, from SELECT and JOINs to subqueries and window functions. Run SQL queries live in an interactive SQL Playground.

October 1, 2026October 20, 2026

[![Supercharge Your Database Skills: Try Our New Interactive SQL Plugin!](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/09/pexels-photo-1181469.jpeg?resize=1200%2C900&ssl=1)](https://srinimf.com/2026/09/30/supercharge-your-database-skills-try-our-new-interactive-sql-plugin/)

## [Supercharge Your Database Skills: Try Our New Interactive SQL Plugin!](https://srinimf.com/2026/09/30/supercharge-your-database-skills-try-our-new-interactive-sql-plugin/)

Struggling with database queries? Explore our new interactive SQL plugin to write, test, and master SQL directly in your browser. Try the live demo now!

September 30, 2026October 10, 2026

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2016%2F04%2F06%2Fcics-sample-program-to-read-a-file%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2016%2F04%2Fpexels-photo-6457584.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=CICS%20Sample%20Program%20to%20Read%20a%20File)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20CICS%20Sample%20Program%20to%20Read%20a%20File&body=https%3A%2F%2Fsrinimf.com%2F2016%2F04%2F06%2Fcics-sample-program-to-read-a-file%2F&share=email)
-

### Like this:

Like Loading…
