Page 1 of 1

COBOL VSAM and DB2.

Posted: Wed Apr 02, 2014 3:30 pm
by HafeezAkmal
Hi,

As in case of a COBOL DB2 program we include SQLCA and DCLGEN member etc. in program, which tells about the structure of the table to program however while using VSAM what we do? Can we generate the layout of the VSAM likewise?

Re: COBOL VSAM and DB2.

Posted: Wed Apr 02, 2014 5:23 pm
by Robert Sample
No. Unlike a data base, a VSAM data set consists of records just like a sequential file. Unless you have something giving the layout of the records (such as the program writing the data or application documentation), there is no way to look at a VSAM (or sequential) record and know the fields and their format.

Re: COBOL VSAM and DB2.

Posted: Thu Apr 03, 2014 9:10 am
by Anuj Dhawan
You should also note that having DCLGEN in a program is not a necessity. You could just use any other COBOL copybook to define the structure of your DB2 table and refer the variables from this copybook in program and it'll work. Using DCLGEN had been a choice rather than a mandate...

Re: COBOL VSAM and DB2.

Posted: Mon Sep 29, 2014 4:33 pm
by HafeezAkmal
Thanks Robert and Anuj.