View previous topic :: View next topic
|
Author |
Message |
mosesanand
New User
Joined: 10 Mar 2007 Posts: 1 Location: Bangalore
|
|
|
|
I wanto to know how to get the last record's key present in a VSAM KSDS, through COBOL coding in CICS region. |
|
Back to top |
|
|
nandakumar Warnings : 2 New User
Joined: 05 May 2005 Posts: 50
|
|
|
|
Hi,
you can get the key value of last record in the vsam file by moving high values to the key field ,then start browse and read the file.
FOR EXAMPLE:
01 EMPREC.
02 EMP-NO PIC X(5).
02 EMP-NAME PIC X(10).
assuming EMP-NO as key and file name as EMP-FILE.
MOVE HIGH-VALUES TO EMP-NO.
START EMP-FILE KEY >= EMP-NO.
READ EMP-FILE.
Please let me know if I am wrong.
Thanks,
Nandakumar |
|
Back to top |
|
|
munikumar Currently Banned New User
Joined: 18 Apr 2007 Posts: 24 Location: India
|
|
|
|
Nandakumar your are absolutely right in normal COBOL batch environment.
Anand, I am just confused wit your question. You are asking for COBOL code to point the record then what do you mean by "in CICS region". Do you mean an on-line VSAM file? If so, you will have to use STARTBR and READNEXT.
Regards
Munikumar G |
|
Back to top |
|
|
|