View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear All,
In our shop, in recent past DISPLAY statement should not be used in any COBOL program.
But I have an existing program, which has exclusively used DISPLAY statements quite some time back.
DISPLAY statements were used to display
1) File-operation error messages
2) No. of Records (Accounts) Read in each input file
3) No. of Records (Accounts) written to each output file
4) List of those Accounts that are not matched with that of master file.
5) Couple of DATES
in the production job log.
Now I have to make some change in the business logic, which have already achieved now.
And the challenge is to ensure that the modified program should take care of above 5 kinds of DISPLAY's in production job log without DISPLAY statement
I have one idea of using an output file, and writing all the messages to that file. But problem is the file will be overwritten the next day and I will loose the data of today.
Please suggest me the alternatives to throw error messages without using DISPLAY statements. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Define an output file and assign it to sysout=*, open it and write your error messages etc. In case of an abend you may lose the last the message written because of buffering etc. Limiting displays in a program is a good idea but the extra overhead and complexity of opening a file, formatting messages and writing to a file, and closing the file may be more then you would save. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
message file GDG |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i have been to a few technically challanged sites where they made it a rule:
NO DISPLAY STATEMENTS only WRITE TO PROGRAM-PROGRESS-FILES.
this idiocy of course caused untold extra work as well as many production abends.
simply write a cobol module that is dynamically called
which has a file, and writes to this file.
procedure division using num-parms, parm-1, parm-2, parm-3, parm-4, etc...
a little code was required to manipulate and use the parameters.
write a rexx to modify all modules,
replacing all DISPLAYs with
CALL ws-new-mod using num-parms, parm-1, parm-2, parm-3, etc... |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Thanks all of you.
I will try this out today and will update my status tomorrow. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Craq Giegerich wrote: |
Define an output file and assign it to sysout=*, open it and write your error messages etc. |
Craig - I miss to understand the comment of "opening the SYSOUT" file with COBOL program. Pardon my ignorance, if it's not too much to ask, can you please explain this or direct me to some link.
have a good one,
Regards, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
//outputfl dd sysout=* |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks Dick - idiot in me, anyhow, missed to comprehend the bold text
Quote: |
Define an output file and assign it to sysout=*, open it and write your error messages etc |
.
Thanks for your time - have a good one |
|
Back to top |
|
|
|