IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Alternative to DISPLAY Statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Jun 17, 2010 6:05 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 17, 2010 6:23 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jun 17, 2010 6:31 pm
Reply with quote

message file GDG
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 17, 2010 6:37 pm
Reply with quote

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
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Jun 17, 2010 6:53 pm
Reply with quote

Thanks all of you.
I will try this out today and will update my status tomorrow.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 17, 2010 8:20 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 17, 2010 8:29 pm
Reply with quote

//outputfl dd sysout=*
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 17, 2010 9:48 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts How to display the leading zeros of a... DB2 7
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts SDSF display Max-RC in different colors TSO/ISPF 4
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
Search our Forums:

Back to Top