Interview Questions   Tutorials   Discussions   Programs   

CICS - What CICS command would you use to read a VSAM KSDS sequentially in ascending order?




306
views
asked mar September 7, 2014 05:30 AM  

What CICS command would you use to read a VSAM KSDS sequentially in ascending order?


           

1 Answers



 
answered By Mswami   0  

You read a record in the file with the READ command.

When reading from a KSDS, you can identify the record you want uniquely by specifying its full key, or you can retrieve the first (lowest key) record whose key meets certain requirements. There are two options that qualify your key value; GENERIC and GTEQ.

The GENERIC option indicates that you require a match on only a part of the key; when you specify the GENERIC option, you also must specify the KEYLENGTH option, to say how many positions of the key, starting from the left, must match. For the READ command, CICS uses only the first KEYLENGTH option characters.

The GTEQ option indicates that you want the first record whose key is "greater than or equal to" the key you have specified. You can use GTEQ with either a full or a generic key.

The opposite of the GTEQ option is the EQUAL option (the default), which means that you want only a record whose key matches exactly that portion (full or generic) of the key that you have specified.

Example:

EXEC CICS READNEXT
DATASET(NAME)/FILE(NAME)
INTO(DATA-AREA)
LENGTH(DATA-VALUE)
RIDFLD(DATA-AREA)
END-EXEC.

The READNEXT command is used to read a record of a file sequentially forward.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert