Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CICS with VSAM(KSDS) through COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: CICS with VSAM(KSDS) through COBOL
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    Post subject: Re: CICS with VSAM(KSDS) through COBOL
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us