Report generation...



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

Report generation...

Postby slaxman9 » Mon Nov 05, 2012 12:44 pm

I have two files, one is emp file and second is dept file.
In first file (emp file) i have emp Id , empname, dept name and second file(dept file) i have dept id, dept name.

Now i have to generate a report with empid, empname, dept name.???

Can any one help me on this???
slaxman9
 
Posts: 6
Joined: Mon Jul 11, 2011 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Report generation...

 

Re: Report generation...

Postby Pandora-Box » Mon Nov 05, 2012 12:57 pm

Slaxman

You already have the details in Emp file

Please let us know the correct details
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: Report generation...

Postby slaxman9 » Mon Nov 05, 2012 1:02 pm

slaxman9 wrote:I have two files, one is emp file and second is dept file.
In first file (emp file) i have emp Id , empname, dept name and second file(dept file) i have dept id, dept name.

Now i have to generate a report with empid, dept name.???

Can any one help me on this???
slaxman9
 
Posts: 6
Joined: Mon Jul 11, 2011 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Report generation...

Postby Pandora-Box » Mon Nov 05, 2012 1:11 pm

Still you have the details in Emp file

All you need to do is Read emp file populate empid and dept name to Ws section write report using that

Still I doubt your requirement
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: Report generation...

Postby Robert Sample » Mon Nov 05, 2012 3:22 pm

If you have dept name in the emp file as you have posted, you read a record, move the data to a print line, write the report file from the print line, and continue until end of file.

If, as is more likely, you have dept id in the emp file, then you first read all dept file records into a table in WORKING-STORAGE. You then read each record of the emp file, search the table for the dept id (which you can do yourself or use the SEARCH verb in COBOL) and use the associated dept name in the print line.

Note that we will help you on this forum, but this is NOT a write-the-code-for-you forum. If you want code written for you, be prepared to pay the daily rate for whoever agrees to write the code (and daily rates are typically 500 to 1000 U.S. dollars per day).
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post