COBOL VSAM and DB2.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
HafeezAkmal
New Member
Posts: 7
Joined: Tue Apr 01, 2014 8:59 pm

COBOL VSAM and DB2.

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL VSAM and DB2.

Post 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.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL VSAM and DB2.

Post 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...
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
HafeezAkmal
New Member
Posts: 7
Joined: Tue Apr 01, 2014 8:59 pm

Re: COBOL VSAM and DB2.

Post by HafeezAkmal »

Thanks Robert and Anuj.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”