From: Doug Miller on
In article <8626ljFfplU1(a)mid.individual.net>, "Pete Dashwood" <dashwood(a)removethis.enternet.co.nz> wrote:
>Doug Miller wrote:
>> In article <86256pF6niU1(a)mid.individual.net>, "Pete Dashwood"
>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>> jmoore wrote:
>>>> On May 25, 9:18 am, jmoore <jmoore...(a)gmail.com> wrote:
>>>>> I have a program that was written in a weird structure. I was
>>>>> wondering if anyone knew a way to call unix to suppress an error
>>>>> message if the cobol print file is empty.
>>>>>
>>>>> SEDC Main 9K:noitems $ run pub/
>>>>> slaudit
>>>>> 05/25/10 BEGIN SECURITY LIGHT AUDIT 09:19 AM
>>>>>
>>>>> DO YOU WISH TO RUN THIS PROGRAM? Y/N/S/E
>>>>> Y
>>>>> NO QUALIFYING RECORDS FOUND
>>>>>
>>>>> coblp: empty output, no spoolfile created for
>>>>>
>>>>> 05/25/10 END SECURITY LIGHT AUDIT 09:19 AM
>>>>>
>>>>> I need to compress the coblp message if the print-file is empty.
>>>>> Any help would be appreciated. Thank you!
>>>>
>>>> Sorry I meant suppress
>>>
>>> redirect STDERR to the bit bucket... like this:
>>>
>>> SEDC Main 9K:noitems $ run pub/slaudit 2> /dev/null
>>
>> That's going to send *all* his error messages to the bit bucket --
>> probably
>> undesirable.
>
>Not if you don't want to see them :-)

He didn't say he didn't want to see any of them, just that he didn't want to
see _one specific_ message.
>
>He COULD change it to a file name.

More practical to redirect to a shell script that discards the message(es) he
doesn't want to see, and displays everything else.
From: Pete Dashwood on
Doug Miller wrote:
> In article <8626ljFfplU1(a)mid.individual.net>, "Pete Dashwood"
> <dashwood(a)removethis.enternet.co.nz> wrote:
>> Doug Miller wrote:
>>> In article <86256pF6niU1(a)mid.individual.net>, "Pete Dashwood"
>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>> jmoore wrote:
>>>>> On May 25, 9:18 am, jmoore <jmoore...(a)gmail.com> wrote:
>>>>>> I have a program that was written in a weird structure. I was
>>>>>> wondering if anyone knew a way to call unix to suppress an error
>>>>>> message if the cobol print file is empty.
>>>>>>
>>>>>> SEDC Main 9K:noitems $ run pub/
>>>>>> slaudit
>>>>>> 05/25/10 BEGIN SECURITY LIGHT AUDIT 09:19 AM
>>>>>>
>>>>>> DO YOU WISH TO RUN THIS PROGRAM? Y/N/S/E
>>>>>> Y
>>>>>> NO QUALIFYING RECORDS FOUND
>>>>>>
>>>>>> coblp: empty output, no spoolfile created for
>>>>>>
>>>>>> 05/25/10 END SECURITY LIGHT AUDIT 09:19 AM
>>>>>>
>>>>>> I need to compress the coblp message if the print-file is empty.
>>>>>> Any help would be appreciated. Thank you!
>>>>>
>>>>> Sorry I meant suppress
>>>>
>>>> redirect STDERR to the bit bucket... like this:
>>>>
>>>> SEDC Main 9K:noitems $ run pub/slaudit 2> /dev/null
>>>
>>> That's going to send *all* his error messages to the bit bucket --
>>> probably
>>> undesirable.
>>
>> Not if you don't want to see them :-)
>
> He didn't say he didn't want to see any of them, just that he didn't
> want to
> see _one specific_ message.
>>
>> He COULD change it to a file name.
>
> More practical to redirect to a shell script that discards the
> message(es) he
> doesn't want to see, and displays everything else.

Er... discarding the messages he doesn't want to see was, I believe, the nub
of his problem.

Why not post some code in support of your sugestion and he can pick whatever
solution he wants?

(BTW, I don't claim Unix/Linux expertise... I'm just trying to help.)

Pete.
--
"I used to write COBOL...now I can do anything."


From: Doug Miller on
In article <862ajbF8rhU1(a)mid.individual.net>, "Pete Dashwood" <dashwood(a)removethis.enternet.co.nz> wrote:
>Doug Miller wrote:
>> In article <8626ljFfplU1(a)mid.individual.net>, "Pete Dashwood"
>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>> Doug Miller wrote:
>>>> In article <86256pF6niU1(a)mid.individual.net>, "Pete Dashwood"
>>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>>> jmoore wrote:
>>>>>> On May 25, 9:18 am, jmoore <jmoore...(a)gmail.com> wrote:
>>>>>>> I have a program that was written in a weird structure. I was
>>>>>>> wondering if anyone knew a way to call unix to suppress an error
>>>>>>> message if the cobol print file is empty.
>>>>>>>
>>>>>>> SEDC Main 9K:noitems $ run pub/
>>>>>>> slaudit
>>>>>>> 05/25/10 BEGIN SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>
>>>>>>> DO YOU WISH TO RUN THIS PROGRAM? Y/N/S/E
>>>>>>> Y
>>>>>>> NO QUALIFYING RECORDS FOUND
>>>>>>>
>>>>>>> coblp: empty output, no spoolfile created for
>>>>>>>
>>>>>>> 05/25/10 END SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>
>>>>>>> I need to compress the coblp message if the print-file is empty.
>>>>>>> Any help would be appreciated. Thank you!
>>>>>>
>>>>>> Sorry I meant suppress
>>>>>
>>>>> redirect STDERR to the bit bucket... like this:
>>>>>
>>>>> SEDC Main 9K:noitems $ run pub/slaudit 2> /dev/null
>>>>
>>>> That's going to send *all* his error messages to the bit bucket --
>>>> probably
>>>> undesirable.
>>>
>>> Not if you don't want to see them :-)
>>
>> He didn't say he didn't want to see any of them, just that he didn't
>> want to
>> see _one specific_ message.
>>>
>>> He COULD change it to a file name.
>>
>> More practical to redirect to a shell script that discards the message(es) he
>> doesn't want to see, and displays everything else.
>
>Er... discarding the messages he doesn't want to see was, I believe, the nub
>of his problem.

Exactly so -- so what is the point of recommending a method that discards
*all* messages written to stderr? That's not what he wants. He wants to
suppress or discard _one specific message_. Redirecting to dev/null is sure
to discard that message, but it will also discard _everything else_ written to
stderr.
>
>Why not post some code in support of your sugestion and he can pick whatever
>solution he wants?

Why not? Multiple reasons:
1) it's off-topic here; comp.unix.shell is a better place
2) it's been seven years since I've done Unix shell scripting for a living;
anything I'd write now is likely to be a bit shaky
3) without knowing which shell he's using, it's pointless to try anyway

>(BTW, I don't claim Unix/Linux expertise...

I hadn't guessed.

From: Pete Dashwood on
Doug Miller wrote:
> In article <862ajbF8rhU1(a)mid.individual.net>, "Pete Dashwood"
> <dashwood(a)removethis.enternet.co.nz> wrote:
>> Doug Miller wrote:
>>> In article <8626ljFfplU1(a)mid.individual.net>, "Pete Dashwood"
>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>> Doug Miller wrote:
>>>>> In article <86256pF6niU1(a)mid.individual.net>, "Pete Dashwood"
>>>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>>>> jmoore wrote:
>>>>>>> On May 25, 9:18 am, jmoore <jmoore...(a)gmail.com> wrote:
>>>>>>>> I have a program that was written in a weird structure. I was
>>>>>>>> wondering if anyone knew a way to call unix to suppress an
>>>>>>>> error message if the cobol print file is empty.
>>>>>>>>
>>>>>>>> SEDC Main 9K:noitems $ run pub/
>>>>>>>> slaudit
>>>>>>>> 05/25/10 BEGIN SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>>
>>>>>>>> DO YOU WISH TO RUN THIS PROGRAM? Y/N/S/E
>>>>>>>> Y
>>>>>>>> NO QUALIFYING RECORDS FOUND
>>>>>>>>
>>>>>>>> coblp: empty output, no spoolfile created for
>>>>>>>>
>>>>>>>> 05/25/10 END SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>>
>>>>>>>> I need to compress the coblp message if the print-file is
>>>>>>>> empty. Any help would be appreciated. Thank you!
>>>>>>>
>>>>>>> Sorry I meant suppress
>>>>>>
>>>>>> redirect STDERR to the bit bucket... like this:
>>>>>>
>>>>>> SEDC Main 9K:noitems $ run pub/slaudit 2> /dev/null
>>>>>
>>>>> That's going to send *all* his error messages to the bit bucket --
>>>>> probably
>>>>> undesirable.
>>>>
>>>> Not if you don't want to see them :-)
>>>
>>> He didn't say he didn't want to see any of them, just that he didn't
>>> want to
>>> see _one specific_ message.
>>>>
>>>> He COULD change it to a file name.
>>>
>>> More practical to redirect to a shell script that discards the
>>> message(es) he doesn't want to see, and displays everything else.
>>
>> Er... discarding the messages he doesn't want to see was, I believe,
>> the nub of his problem.
>
> Exactly so -- so what is the point of recommending a method that
> discards *all* messages written to stderr? That's not what he wants.
> He wants to
> suppress or discard _one specific message_. Redirecting to dev/null
> is sure
> to discard that message, but it will also discard _everything else_
> written to
> stderr.
>>
>> Why not post some code in support of your sugestion and he can pick
>> whatever solution he wants?
>
> Why not? Multiple reasons:
> 1) it's off-topic here; comp.unix.shell is a better place
> 2) it's been seven years since I've done Unix shell scripting for a
> living;
> anything I'd write now is likely to be a bit shaky
> 3) without knowing which shell he's using, it's pointless to try
> anyway
>
>> (BTW, I don't claim Unix/Linux expertise...
>
> I hadn't guessed.

--
"I used to write COBOL...now I can do anything."


From: Pete Dashwood on
Sorry for blank response... finger trouble.

Some comments below...

Doug Miller wrote:
> In article <862ajbF8rhU1(a)mid.individual.net>, "Pete Dashwood"
> <dashwood(a)removethis.enternet.co.nz> wrote:
>> Doug Miller wrote:
>>> In article <8626ljFfplU1(a)mid.individual.net>, "Pete Dashwood"
>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>> Doug Miller wrote:
>>>>> In article <86256pF6niU1(a)mid.individual.net>, "Pete Dashwood"
>>>>> <dashwood(a)removethis.enternet.co.nz> wrote:
>>>>>> jmoore wrote:
>>>>>>> On May 25, 9:18 am, jmoore <jmoore...(a)gmail.com> wrote:
>>>>>>>> I have a program that was written in a weird structure. I was
>>>>>>>> wondering if anyone knew a way to call unix to suppress an
>>>>>>>> error message if the cobol print file is empty.
>>>>>>>>
>>>>>>>> SEDC Main 9K:noitems $ run pub/
>>>>>>>> slaudit
>>>>>>>> 05/25/10 BEGIN SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>>
>>>>>>>> DO YOU WISH TO RUN THIS PROGRAM? Y/N/S/E
>>>>>>>> Y
>>>>>>>> NO QUALIFYING RECORDS FOUND
>>>>>>>>
>>>>>>>> coblp: empty output, no spoolfile created for
>>>>>>>>
>>>>>>>> 05/25/10 END SECURITY LIGHT AUDIT 09:19 AM
>>>>>>>>
>>>>>>>> I need to compress the coblp message if the print-file is
>>>>>>>> empty. Any help would be appreciated. Thank you!
>>>>>>>
>>>>>>> Sorry I meant suppress
>>>>>>
>>>>>> redirect STDERR to the bit bucket... like this:
>>>>>>
>>>>>> SEDC Main 9K:noitems $ run pub/slaudit 2> /dev/null
>>>>>
>>>>> That's going to send *all* his error messages to the bit bucket --
>>>>> probably
>>>>> undesirable.
>>>>
>>>> Not if you don't want to see them :-)
>>>
>>> He didn't say he didn't want to see any of them, just that he didn't
>>> want to
>>> see _one specific_ message.
>>>>
>>>> He COULD change it to a file name.
>>>
>>> More practical to redirect to a shell script that discards the
>>> message(es) he doesn't want to see, and displays everything else.
>>
>> Er... discarding the messages he doesn't want to see was, I believe,
>> the nub of his problem.
>
> Exactly so -- so what is the point of recommending a method that
> discards *all* messages written to stderr? That's not what he wants.

He stated that he wants an error message (the only one curently produced
from that particular application) suppressed.

The code I posted would certainly achieve that.

Certainly it would also suppress any other error messages from that
application, but,as far as we know, there are no other error messages coming
out of the application.

If this is actually a problem for him, he could easily have the STDERR
messages written to a file for examination and analysis later.

Now, I would be the first to admit that what I suggested is not a refined or
elegant solution, but it DOES achieve what was requested. Someone with in
depth Unix experience could almost certainly suggest a better alternative,
but there doesn't appear to be anybody here who is prepared to do that.


> He wants to
> suppress or discard _one specific message_. Redirecting to dev/null
> is sure
> to discard that message, but it will also discard _everything else_
> written to
> stderr.

Yes. It will. I don't see this as being disastrous, but it is really up to
the OP. If that IS a problem for him then he must seek a better solution
elsewhere. Your opinion about it or my opinion about it is not relevant. It
is what the OP thinks about it that is important.

They guy wants help, not opinions.

>>
>> Why not post some code in support of your sugestion and he can pick
>> whatever solution he wants?
>
> Why not? Multiple reasons:
> 1) it's off-topic here; comp.unix.shell is a better place

Oh dear, an off-topic post in CLC? That would be a dangerous precedent :-)

comp.unix.shell might well be a better place. How hard would it have been to
simply suggest that?

> 2) it's been seven years since I've done Unix shell scripting for a
> living;
> anything I'd write now is likely to be a bit shaky

And yet your rustiness has not prevented you from criticising someone else's
attempt to help. There is an old saying: "Any fool can find fault". It takes
a wise man to find fault wisely. Simply saying that something is not a good
solution, without providing a means to improve it or a better alternative,
is just not helpful.

Having done Unix shell scripting for a living you are certainly better
placed than I am to provide a solution. Yet you won't because it might not
be perfect.

If you posted some code and it isn't perfect, might it not point the OP
towards something that is better? (You could add a disclaimer if you are
worried about your code being "shaky".)


> 3) without knowing which shell he's using, it's pointless to try
> anyway

Sure. Might as well give up.

Are Unix shells really so different that redirection doesn't work
consistently?


>
>> (BTW, I don't claim Unix/Linux expertise...
>
> I hadn't guessed.

:-)

At least I tried.

It isn't about who's right, it's about what's right. You agree that what I
posted would achieve the requested result. Your reservation about it is that
it might also have an unwanted side effect (a very valid observation, but
arguable in this specific instance). We both agree that there could be a
better solution, but neither of us can explain it at a level where it is
helpful to the OP. I can't because I don't have the knowledge, you won't
because you are afraid it might not be perfect.

So where does that leave him?

Sometimes it is better to have A solution (which can be subsequently refined
or iterated) than to have NO solution; sometimes a bad solution is worse
than no solution.

I contend that in this case the former is more applicable than the latter,
because if he does what I suggested he will be no worse off than if he does
nothing. In other words, it can "do no harm". If there was another error
posted and he didn't see it, the application would fail and it would need to
be re-run with error output either turned on or redirected to a file. No
harm has been done.

I think you are underestimating your own capacity to help, Doug.

Pete.
--
"I used to write COBOL...now I can do anything."


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Acucobol Error 98.13
Next: How to talk like a programmer