---
title: "CICS-Sequential and Random Access"
description: "What is Random access and Sequential access in CICS mainframe"
url: https://srinimf.com/2012/03/31/cics-sequential-and-random-access/
date: 2012-03-31
modified: 2026-10-08
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2012/03/cics-random-and-sequential.jpg?fit=1200%2C900&ssl=1
categories: ["CICS Tips"]
tags: ["CICS", "Random", "Sequential"]
type: post
lang: en
---

# CICS-Sequential and Random Access

Not only in CICS, in any of the mainframe Technologies, but the reading of the files can also be done in multiple ways.

Sequential &
[Random Access](https://srinimf.com/2016/03/17/indexed-files/)

Especially in CICS, Sequential and Random access are most popular ways of reading files.

[Sequential Access](https://srinimf.com/2012/05/16/vsam-ksds-esds-lds-rrds-and-their-uses/): STARTBR (start browse) keeps record at the key position, from where we want to read a record.

READNEXT-will actually read the record into working storage file description area.

**Sample syntax:**

```
EXEC CICS STARTBR
   DATASET('FILEAA')
   RIDFILD(REC-IO-KEY)==> Record Key
  GTEQ
END-EXEC.
```

—-

```
EXEC CICS READNEXT
   DATASET('FILEAA')
    INTO(FILE-IO-AREA) ==working storage file description at '01' level
   RIDFILD(REC-IO-KEY)==>Record Key
   GTEQ
END-EXEC.
```

Random Access: File reading by this way will be achieved with “[READ](http://www.amazon.com/gp/product/189077409X/ref=as_li_tf_il?ie=UTF8&tag=mainframesrin-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=189077409X)” command. It reads the record, as per key mentioned, and moves into working storage record area.

**Sample syntax:**

```
EXEC CICS READ
   DATASET('FILEAA')
    INTO(FILE-IO-AREA) ==working storage file description at '01' level
   RIDFILD(REC-IO-KEY)==>Record Key
   GTEQ
END-EXEC.
```

These may look simple, but, many people do not have much idea. I am sure it will help you.

In my next posts, I will give how data will be retrieved by using DB2 and IMSDB.

### 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%2F2012%2F03%2F31%2Fcics-sequential-and-random-access%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2012%2F03%2Fcics-random-and-sequential.jpg%3Ffit%3D1200%252C900%26ssl%3D1&description=CICS-Sequential%20and%20Random%20Access)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2012/03/31/cics-sequential-and-random-access/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2012/03/31/cics-sequential-and-random-access/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2012/03/31/cics-sequential-and-random-access/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2012/03/31/cics-sequential-and-random-access/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20CICS-Sequential%20and%20Random%20Access&body=https%3A%2F%2Fsrinimf.com%2F2012%2F03%2F31%2Fcics-sequential-and-random-access%2F&share=email)
-

### Like this:

Like Loading…
