Series: Subject: Topic:
Question: 156 of 178

How to browse Vsam files in ascending order and in descending order?

Asked by: Interview Candidate | Asked on: Jul 26th, 2006
Showing Answers 1 - 3 of 3 Answers

Answered On : Sep 9th, 2006

We have to access the VSAM file in sequential mode.Since VSAM files are arranged in key sequence of acesending order .declare the file as follows:For example in PL1:Declare the file name as follows.DCL vsamfile file input sequential env(vsam);To browse in ascending order :dcl Vsamfile file input sequential env(vsam) bkwd;jai

Login to rate this answer.

Answered On : Sep 11th, 2006

View all answers by techieheart

As a programmer, I always try not to use complicated logic. To answer your question:Ascending: Declare in COBOL as Access mode is sequential, then do a normal read.Descending:1. Repro file to a flat file2. Use utility sort with D (descending parameter) on the flat file.3. Use the flat file in your read.

Yes  1 User has rated as useful.
Login to rate this answer.

Simple, create an alternate index on the key descending.

Yes  1 User has rated as useful.
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions



twitter fb Linkedin GPlus RSS


Question Categories

CICS Interview Questions

COBOL Interview Questions

DB2 Interview Questions

IDMS Interview Questions

JCL Interview Questions

VSAM Interview Questions

Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.