---
title: "CICS Sample Program to Write Header and Footer"
description: "CICS sample program you can use to write header and footer. Read more."
url: https://srinimf.com/2016/04/06/cics-sample-code-for-header-and-footer/
date: 2016-04-06
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2018/06/pexels-photo-860564-e1537504804293.jpeg?fit=600%2C450&ssl=1
categories: ["CICS"]
tags: ["CICS Header and Footer Program"]
type: post
lang: en
---

# CICS Sample Program to Write Header and Footer

I am giving here my [sample program](https://srinimf.com/2016/04/06/cics-sample-program-to-read-a-file/) where you can write header and footer.

```
ID DIVISION.
 PROGRAM-ID. SRINIMF.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01 RES.
   02 A PIC 9(3).
   02 B PIC 9(3).
   02 C PIC 9(4).
 77 Z PIC X(80).
 01 REC.
    02 MSG PIC X(79) VALUE SPACES.
 01 TEXT-HDR.
    02 LEN PIC S9(4) COMP VALUE 79.
    02 FILLER PIC X VALUE '&'.
    02 FILLER PIC X.
    02 FILLER PIC X(79) VALUE "INDIAN AIRLINES".
 01 TEXT-TR.
    02 LENG PIC S9(4) COMP VALUE 79.
    02 FILLER PIC X VALUE '&'.
    02 FILLER PIC X.
    02 FLLLER PIC X(79) VALUE "THANKYOU".
 77 LENGT PIC S9(4) COMP.
 PROCEDURE DIVISION.
 PERFORM PARA1 5 TIMES.
 PARA1.
 MOVE "WELCOME TO CHENNAI" TO REC.
 MOVE 79 TO LENGT.
 EXEC CICS
      SEND TEXT FROM(REC)
      HEADER(TEXT-HDR)
      ACCUM
      PAGING
      ERASE
 END-EXEC.
 PARA2.
 EXEC CICS 
      SEND PAGE
      TRAILER(TEXT-TR)
 END-EXEC.
EXEC CICS 
     RETURN 
END-EXEC.
```

**Also read**

### 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-code-for-header-and-footer%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2018%2F06%2Fpexels-photo-860564-e1537504804293.jpeg%3Ffit%3D600%252C450%26ssl%3D1&description=CICS%20Sample%20Program%20to%20Write%20Header%20and%20Footer)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/04/06/cics-sample-code-for-header-and-footer/?share=jetpack-whatsapp)
- [More](#)
-

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

### Like this:

Like Loading…
