Page 1 of 1

Generating a report on a VSAM file

PostPosted: Thu Jul 19, 2018 12:36 am
by sar97
I am making a payslip project using IBM mainframes and I am asked to create a payslip report for an employee every month. I can fetch the data of any employee from a central DB2 database. This payslip is supposed to be stored into a VSAM file in a format as follows:

The problem is that I don't know the method to write contents into the file in such a user formatted style.
So can anyone please send me a COBOL code to help me out because when I searched on the internet, all I could find was how to store data in a key-sequenced record format.

Also please tell as to what type of VSAM I should use.

Re: Generating a report on a VSAM file

PostPosted: Thu Jul 19, 2018 1:12 am
by Robert Sample
You could store the data in a KSDS -- using, for example, the employee number and year/month as key. Instead of having one record per line, store all lines in a single record (or include a line number as part of the key and store each line as a separate record). Or you could use an ESDS, storing the data in a single line or multiple lines again. You can choose whichever makes most sense to you. Also, most of the time you would store the data in the VSAM data set and not store each line of the payslip as you showed it -- it is pretty easy to generate the payslip once you have the data.
So can anyone please send me a COBOL code to help me out because when I searched on the internet, all I could find was how to store data in a key-sequenced record format.
This is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. If you ask for code, be prepared to pay the going rate for professional assistance (typically somewhere between 500 and 2000 US dollars per day of assistance).

Hopefully, such a project is a homework assignment. Because if a company is asking you to write such code, there are serious security issues that need to be addressed (such as storing pay data in a VSAM data set).

Re: Generating a report on a VSAM file

PostPosted: Thu Jul 19, 2018 2:44 pm
by NicC
Do not post the same topic on mutiple forums. It is rude. Effctively, what you are saying is that you do not trust the people on one forum so you think you will get better elsewhere. In fact, you are likely to get better mainframe responses here than on the other forum I found this on.