Page 1 of 2

report writing

PostPosted: Tue Aug 02, 2011 8:16 pm
by ramesh reddy
i have one file like.
branch a/c no
1408 123456
1408 123456
1408 123456
1407 456789
1407 456789
1407 456789
like i have no.of records with same a/c no.
now i want to generate a report
Expected result:
branch >20(repeated a/c's count) <20(repeated a/c's count)
1408 0 3
1407 0 3
i want a report repeated accounts count under particular branch.
plz help me........can u give code....

Re: report writing

PostPosted: Tue Aug 02, 2011 8:52 pm
by Robert Sample
We help you with code, but we typically don't provide you with code since you are not learning if you are given what you want. So what have you tried so far and what are you having trouble with?

Is this a homework assignment?

Are you using the COBOL REPORT WRITER or are you using regular COBOL statements to accomplish this report?

Re: report writing

PostPosted: Tue Aug 02, 2011 10:47 pm
by dick scherrer
Hello,

Is this a homework assignment?
It is quite allright it this is homework - one of the maine reasons this forum was opened was to help students.

As Robert mentoned, we will help - sometimes in great detail - but we do not intend to post entire solutions. We expect people to work and learn.

With only a few exceptions, if someon posts "the code" it is deleted . . .

Good luck,

d

Re: report writing

PostPosted: Wed Aug 03, 2011 3:20 am
by ramesh reddy
yes..this is homework assignment.
no need entire code..just i need how to do this ..a brief explain.
i am tying ,but not correct result.somewhere i am doing mistake.
thanks.

Re: report writing

PostPosted: Wed Aug 03, 2011 3:27 am
by dick scherrer
Hello,

If you post what you have done so far, someone should be able to help resolve any problems. When posting, use the Code tag - we have a Preview option that wioll let you see your post as it will appera to the forum. When you are satisfied with how the post appears, Submit.

It iwll also help if you post a bit of the problem output and what it should have been.

Re: report writing

PostPosted: Wed Aug 03, 2011 3:54 am
by Robert Sample
Define a WORKING-STORAGE variable to hold the current branch id. Open the files, read the first record, set the count to one, move the branch id to the hold variable. Then loop until end of file: read the file, compare the branch id to the held branch id. If they are the same, add 1 to the count. If they are not the same, write a report line with the branch id and the count, move the read branch id to the hold branch variable, set the count back to 1.

When you're through with the loop, you'll need to write out the last branch id and count, close the files, then you're don.

Re: report writing

PostPosted: Wed Aug 03, 2011 4:41 am
by BillyBoyo
If you google for "cobol report writer manual" you should find an easy-to-use manual from IBM for the product.

The Report Writer does a lot of stuff for you that you'd normally have to code explicitly. The trick is to discover what it can do, and then how to use it, and then to let the Report Writer do it how it wants, with you having provided the information for control fields, sum fields, titles, detail lines etc.

Look up the manual, check out how to do what you want, give it a go and let us know if you get stuck with something, or can't understand how something is working, even if it does.

Re: report writing

PostPosted: Wed Aug 03, 2011 7:36 am
by dick scherrer
Hello,

Most of the sites i work with have not used the COBOL Report Writer for many years.

Whether it may be used for this would also depend on if the instructor will permit it. . .

Re: report writing

PostPosted: Wed Aug 03, 2011 12:02 pm
by BillyBoyo
Hello,

Same here. Got confused by the title and I assumed an affirmative to Robert's question. I even thought it was odd, but didn't double-check. Silly me.

Ramesh, unless you are learning the Report Writer, avoid it. It is a paid-for extra, and most sites don't. So people don't get experience with it. So site's don't use it. So they don't pay fort it. So people don't get... you get the picture.

Re: report writing

PostPosted: Fri Aug 05, 2011 4:28 am
by ramesh reddy
hi,
k..thanks for the information.
now i want to write the count in to file...