Generating a report on a VSAM file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Generating a report on a VSAM file

Postby sar97 » Thu Jul 19, 2018 12:36 am

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.
You do not have the required permissions to view the files attached to this post.
sar97
 
Posts: 1
Joined: Thu Jul 19, 2018 12:26 am
Has thanked: 0 time
Been thanked: 0 time

Re: Generating a report on a VSAM file

 

Re: Generating a report on a VSAM file

Postby Robert Sample » Thu Jul 19, 2018 1:12 am

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).
Robert Sample
Global moderator
 
Posts: 3652
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 269 times

Re: Generating a report on a VSAM file

Postby NicC » Thu Jul 19, 2018 2:44 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3004
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post