Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to create reports using COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 7:25 pm    Post subject: How to create reports using COBOL
Reply with quote

Hi all,

Can I know how to generate reports using COBOL programs.

Thanks in advance,
Priya.
Back to top
View user's profile Send private message

iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Mon Nov 28, 2005 9:42 pm    Post subject: Re: How to create reports using COBOL
Reply with quote

Hi sripriya,

In order to generate reports you must make use of FILLER to design your screen in the form of a report.

NOTE

When the program is not intended to use selected fields in a record structure, define them as FILLER. FILLER items cannot be initialized or used in any operation of the procedure division

P.S.

Please search our forum for more details.

I have attached a sample program which generates report. The code uses Accept(lin,col) and Display(lin,col).
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Nov 28, 2005 9:43 pm    Post subject: Re: How to create reports using COBOL
Reply with quote

Sripriya,

This is one of the main functions of a COBOL program, along with manipulating data.

To generate a report to sysout or a ps file, you need to do the following things in your program.

1 ? define an output file. Generally lrecl 133 in the file division ?FD? along with the associated SELECT.

In the JCL define the report as RECFM=FBA (REPORT is a reserved word pick something else)

2 ? in the working storage section, you need to define each type of line to be written to the file.
a) ? Headers (usually multiple, these contain Titles, Column names, editing line to make the report reader friendly [i.e. underscores for column names, etc]), detail lines, sub-totals and totals line (if appropriate)

3 ? also in working storage you need to define variables for line-count and page-count.

4 ? As you progress through your COBOL program you probably want edit the headers in the initialization paragraph with date, time, program name, starting page # = 1, etc. and write the headers to the file. Set the page-count = 1 and the line-count = however many lines of headers you wrote. (You?ll want to do a search in the forum for line carriage control characters)

Before you write each detail line, you?ll want to check the line-counter, and if greater than a specified value of # lines you want on a page re-write the headers incrementing the page-count and re-setting the line-count.

After each detail line you write, increment the line-count

Note: it?s also good to write a line out if there is nothing to report on a particular run ?i.e. ?NOTHING TO REPORT TODAY? It looks better than a blank report.

Hope this is what you were looking for. There is no magic bullet for creating reports.
Back to top
View user's profile Send private message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Sat Dec 10, 2005 6:40 pm    Post subject: Re: How to create reports using COBOL
Reply with quote

Thanks a lot. The answer was brief enough to get a clear idea.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us