• Rajesh A R

F1 for Mainframe

F1 for Mainframe

Monthly Archives: September 2013

VSAM – KEYS

17 Tuesday Sep 2013

Posted by rajeshar in VSAM

≈ Leave a comment

Tags

KEYS, VSAM

VSAM – KEYS

Consider the below VSAM definition

DEFINE CLUSTER –

(NAME (YOUR.KYMWK15C.VSAM)) –

DATA –

(NAME (YOUR.KYMWK15C.VSAM.DATA) –

CYL(500 500) –

KEYS (04 2) –

RECORDSIZE (6577 6577) –

) –

INDEX –

(NAME (YOUR.KYMWK15C.VSAM.INDEX))

The below data is currently available in the VSAM file.

—-+—-10—+—-20

011234VSAM

123456KEY

234567STARTS

345678AT

Now when a random read on the VSAM file is done with the key value as 3456, what is the record that would be read?

KEYS give information about the prime key field of a key-sequenced data set’s data records. And the KEY is provided as KEYS (length offset) where length represents the length of the KEY field and offset represents the displacement (in bytes) from the beginning of the record.

In our question, KEYS is provided as KEYS (04 2), so the key length is 4 and the OFFSET is 2, which means that the key starts from the 3rd byte. So when we read VSAM file with keys as 3456, the record 123456KEY would be read.

——————————————————————————————————–

In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

——————————————————————————————————–

You may also like to look at:

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
SAS – SAMPLE PROGRAM
CA DISPATCH – Useful Commands
Locate the INVALID data in a field using FILE AID
File-Aid Relational Operators, Data Types
Xpediter – Batch Setup
FILE AID – VIEW TIP
FILEAID TIPS
EDIT PDS USING FILE-AID – FAST MODE
VSAM – KEYS
Comparison of ESDS, KSDS, RRDS, VRRDS, and linear data sets
VSAM OPEN CLOSE I/O RETURN CODES
VSAM INTERVIEW QUESTIONS
VSAM TIPS

Rate this:

← Older posts
Newer posts →

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2020
  • July 2020
  • February 2020
  • January 2020
  • September 2019
  • August 2019
  • October 2018
  • April 2018
  • March 2018
  • December 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • May 2016
  • March 2016
  • February 2016
  • January 2016
  • May 2015
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • January 2013
  • December 2012
  • November 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • April 2011
  • March 2011
  • August 2009
  • June 2009
  • April 2009

Categories

  • Azure
  • CA7
  • CICS
  • COBOL
    • Keywords
  • DB2
  • EASYTRIEVE
  • FILEAID
  • FILEMAXX
  • IMS
  • ISPF
  • JCL
  • KNOW YOUR MAINFRAME
  • Mainframe Migration
  • MAINFRAMES
  • Others
  • REXX
  • SDSF
  • SORT
  • Training
  • TSQL
  • VSAM

Meta

  • Create account
  • Log in

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • F1 for Mainframe
    • Join 90 other subscribers
    • Already have a WordPress.com account? Log in now.
    • F1 for Mainframe
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar