Posted: Tue Oct 04, 2005 5:25 am Post subject: VSAM Processing in Batch Cobol
hi,
I've not used VSAM before, so can anyone help me with a example for batch , how is it different from coding a batch program which accesses a flat file,
any changes to be done in FD, JCL etc..
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Oct 04, 2005 5:38 am Post subject:
Gans79,
Your question is simple and basic, but it will take ages for anyone to explain you all the concepts in one post. Please go thro' the IBM COBOL Programming guide manual (Link is provided below). It provides extensive explanation along with good examples.
how is it different from coding a batch program which accesses a flat file,
Everything is different.
1. FD Section - You need to specify ORGANIZATION, ACCESS MODE, RECORD KEY along with the DD Name that you normally provide for a flat file.
2. READ Statement - Differs a bit from the normal READ for a flat file. You may need to use INVALID KEY and NOT INVALID KEY Phrases.
3. No changes in OPEN & CLOSE statements.
4. VSAM Files can be updated, deleted and new records could be inserted/appended. Whereas in a flat file, you cannot delete records.
5. As far as JCL declaractions are considered, if the VSAM is a input file then there is no difference b/w JCL for VSAM & JCL for a flat file. In case, your VSAM is a output file, then You should use either DISP=OLD or DISP=SHR. DISP=(NEW,CATLG) or (MOD,CATLG) won't work here. You actually have to create a VSAM file beforehand using IDCAMS or Outside the Job and then pass it to the JCL.
Please go thro' the manual and if you have any questions, let us know,
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum