View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi All,
I completely agree that DISPLAY statements are very helpful in debugging in case of failures. But keeping DISPLAY statements for every record we read from VSAM Master files is not a good practice.
One of my program has a DISPLAY statement in it which gets processed for 250,000 times and prints values on SYSOUT each time. Program used by a Daily job.
I don't see much difference in CPU usage in running the program with and without DISPLAY statements.
What are the other benefits I will get in terms of cost savings ?
As programs DISPLAYS unnecessary information on SYSOUT that spreads for 250,000 lines, When I remove the DISPLAYS I will save some space. how to calculate it ?
Numbering internationalised |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
The benefit is in saving spool space.
To see what the space saving would be, maybe try directing SYSOUT to a dataset and see how much space that uses - you'll have to allow for any non-DISPLAY data written to SYSOUT.
Garry |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
@Garry Carroll,
thank you. I will write the spool to a file and estimate the space .
Let's see if there are any other benefits with it. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'm not a big advocate of "whack in some DISPLAYs and see". I'm not even a very small advocate of that.
However, don't even consider taking them out without testing.
One reason I don't like the DISPLAY for "debugging" is that it changes the code, and on occasion that "hides" a problem.
Another reason is that the DISPLAY, for numeric fields, is not always showing you what is actually in the field, such that you may miss a problem simply because the DISPLAY is "lying" to you.
The way to deal with numerics is to MOVE them to numeric-edited items and then DISPLAY that. Do people do that? Not very much.
Another reason is that if you have 250,000 "useless" DISPLAYs, it is "difficult" to spot one meaningful DISPLAY, because it is one amongst 250,000.
Another reason is making the program smaller, and removing non-business requirement "noise".
Another reason is 250,000 is one thing, if you have a Big Fat Loop at some point, you risk filling the spool and making yourself somewhat unpopular.
Etc.
Take them out, but test it. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What is 2,50,000 lines? 250.000? or 2.500.000?
And why is there not a JES2 limit for sysout? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
PeterHolland wrote: |
What is 2,50,000 lines? 250.000? or 2.500.000? |
That's a bit confusing, but this is the way the Indian numbering system works. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I don't see much difference in CPU usage in running the program with and without DISPLAY statements. |
You won't. The current generation of mainframes can execute many, many, many millions of lines of COBOL for each second of CPU time. So removing 250,000 DISPLAY statements won't have much of a CPU impact.
The cost savings, if that is how you are attempting to justify doing this, probably won't be enough to justify doing it. SYSOUT goes to the JES spool (JES2 or JES3), which is pre-allocated and sized by your system support group to handle the entire site. Removing 250,000 DISPLAY statements may allow some other job to use that spool space -- but if your site is that tight on spool space, you'd be running into major issues getting work completed.
The best justification for this is to remove the annoyance factor of not having to see 250,000 lines of output every day. That would be worth quite a bit to me. And if you do get rid of the DISPLAY statement, don't delete them from the code -- change them to comments or debug statements instead by putting an * or a D in column 7! |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
As Robert alluded to, I like to use the "with debugging mode" option of SOURCE-COMPUTER to turn displays on and off. It does require a recompile though. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
PeterHolland wrote: |
What is 2,50,000 lines? 250.000? or 2.500.000?
And why is there not a JES2 limit for sysout? |
Some production shops rig production jobs to have unlimited - or at least very large - SYSOUT limits. I'm inclined to agree with Mr. Sample: the hassle factor of getting rid of the debug output is worth the effort to recertify the program.
It's not necessarily just a JES2 issue, too. Sometimes this output is intercepted by SYSOUT archivers, so it's less space required there. It seems kind of dumb to hang onto debug output for 7 years - or whatever the shop standard is! |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well Marso,
Quote: |
That's a bit confusing, but this is the way the Indian numbering system works. |
I don't really care about Indian numberings. International numbering is what is important. Maybe they are using sanskrit keyboards etc., then i have a hebrew keyboard. |
|
Back to top |
|
|
jerryte
Active User
Joined: 29 Oct 2010 Posts: 203 Location: Toronto, ON, Canada
|
|
|
|
Consider using
Code: |
DISPLAY something UPON SYSPUNCH |
to display a status message to a separate dd SYSPUNCH. It has the added bonus of putting the program name in column 73. This can be sent to sysout which allows you to see the status of a program while it is running.
Another option is to use a counter and display only for every 1000th record
Code: |
ADD 1 TO WS-DISPLAY-COUNT
IF WS-DISPLAY-COUNT = 1000 THEN
DISPLAY something
MOVE 0 TO WS-DISPLAY-COUNT
END-IF |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
That's a nice tip, Jerryte, thanks. I didn't know that.
Anyway, for the topic, junk the DISPLAYs, don't leave them lying around to confuse the code (comments or D in the indicator column, column seven). Remember, they were what someone thought would be useful for some purpose at some time. They may not be, they may be wrong, they may be misleading. They may/will lead you astray one time.
If you feel the overwhelming urge to put DISPLAYs in, think about what you really need, format numeric items, or display the stuff in hex (use the search link about to look for BBHEXD). |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
The place I worked had a special sysout class (SYSOUT=0) that automatically was purged. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Places I have worked do not allow debugging DISPLAYS to be active in production code. A change would get bounced if they were found. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi All,
Lots of valuable points shared here. Thank you.
Moderators,
Thanks for correcting the Indian number system to International
@Bill Woodger,
All the 250,000 DISPLAY statements are useless and does not serve any purpose. There is another DISPLAY statement in place for Error Handling.
@PeterHolland, @Marso, It's Indian Number system.
@Robert Sample, Yes, I will only comment out the unwanted DISPLAYs.
@PeterHolland, SYSOUT =0 I will try it out. But this will purge even the useful messages as well. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
mkk157 wrote: |
@PeterHolland, SYSOUT =0 I will try it out. But this will purge even the useful messages as well. |
Note that this is specific to Mr. Holland's machine. As sysout classes are wholly arbitrary, you must ask your support workgroup what, if anything, is the equivalent in your shop. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
If you don't mind doing the I/O and not seeing the result, you can also:
Add a CBL statement right before the ID DIVISION:
Use the UPON parameter:
Code: |
DISPLAY UPON SYSLIST |
Then have a DD for this logical unit, assigned to SYSOUT or DUMMY, according to your need. |
|
Back to top |
|
|
jerryte
Active User
Joined: 29 Oct 2010 Posts: 203 Location: Toronto, ON, Canada
|
|
|
|
The OUTDD(ddname) compiler option will change where a regular DISPLAY statement is written to instead of the default SYSOUT dd.
Version 4 of Enterprise COBOL seems to allow a
Code: |
DISPLAY something UPON SYSLIST |
I have not tried it yet. |
|
Back to top |
|
|
|