DBA > Job Interview Questions > DB2 INTERVIEW QUESTIONS

How do you read vsam file?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

How do you read vsam file?

A1: VSAM files can be read and write same like cobol files. But only difference is you have to give the dsn path of your vsam file in jcl step while compile time.
select empfile assign to dd1
dd1 will have the dsn parameter with vsam file path.

A2: It is similar to the sequential read but here first a pointer is set and then the file is read from that particular record. For example:
START file name KEY >= file key ( Key of the VSAM file). After the pointer is set the file is read
READ file name NEXT
In PS files we can only do a sequential read but in VSAM we can do a random read and this is possibe by setting the key of the VSAM.

(Continued on next question...)

Other Job Interview Questions