IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CICS with VSAM(KSDS) through COBOL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mosesanand

New User


Joined: 10 Mar 2007
Posts: 1
Location: Bangalore

PostPosted: Sat Mar 10, 2007 9:15 pm
Reply with quote

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
View user's profile Send private message
nandakumar
Warnings : 2

New User


Joined: 05 May 2005
Posts: 50

PostPosted: Sat Mar 10, 2007 9:48 pm
Reply with quote

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
View user's profile Send private message
munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Fri Apr 27, 2007 10:05 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top