Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Alternative to DISPLAY Statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Alternative to DISPLAY Statement
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    Post subject:
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

Active Member


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

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

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

Global Moderator


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

PostPosted: Thu Jun 17, 2010 6:37 pm    Post subject:
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    Post subject: Reply to: Alternative to DISPLAY Statement
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

Senior Member


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

PostPosted: Thu Jun 17, 2010 8:20 pm    Post subject:
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: 6968
Location: porcelain throne

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

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

Senior Member


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

PostPosted: Thu Jun 17, 2010 9:48 pm    Post subject:
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    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
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us