View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
If I code below code into my REXX program,
Code: |
"FREE FI(outdd)"
"FREE FI(indd)" |
and always below message come out, which is not necessary and I do not want it to appear out.
Code: |
IKJ56247I FILE OUTDD NOT FREED, IS NOT ALLOCATED
IKJ56247I FILE INDD NOT FREED, IS NOT ALLOCATED
*** |
How can I achieve this?
thanks.
is there a general way to eliminate some message when TSO command completes? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you have not allocated the file, do not free it. . .
It is simply code that can be modified to work as you wish. . . |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
HI, dick,
I think it's a good practice to Free the file before Allocation, right?
so, message cannot eliminated for TSO command? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes they can, look at MSG in the manuals
Something you should have done before posting here |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Or you could use the REUSE parameter in the ALLOC command. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Marso wrote: |
Or you could use the REUSE parameter in the ALLOC command. |
We are on holiday in China now, please let me test it next Thursday.
thanks for your suggestion first. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Below mentioned will trap the message to array.
Code: |
x = outtrap("zzz.")
"FREE FI(outdd)"
"FREE FI(indd)"
x = outtrap("OFF")
|
|
|
Back to top |
|
|
kbrahma
New User
Joined: 08 Oct 2007 Posts: 38 Location: Delhi
|
|
|
|
I know it's not a good practice to free files when they are not allocated. But I use:-
to suppress TSO messages. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
kbrahma wrote: |
I know it's not a good practice to free files when they are not allocated. But I use:-
to suppress TSO messages. |
Well, actually it is a good practice. Maybe you have processed the same or another REXX or CLIST that has allocated the same file name, but has failed before deallocation. |
|
Back to top |
|
|
kbrahma
New User
Joined: 08 Oct 2007 Posts: 38 Location: Delhi
|
|
|
|
expat wrote: |
kbrahma wrote: |
I know it's not a good practice to free files when they are not allocated. But I use:-
to suppress TSO messages. |
Well, actually it is a good practice. Maybe you have processed the same or another REXX or CLIST that has allocated the same file name, but has failed before deallocation. |
But wouldn't that mean being plauged by those pesky TSO messages if the files have been freed in the previous REXX itself? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I agree with kbrahma. Hunt down the pesky things leaving allocations unfreed, and make some sort of penalty box. Value of two pints of beer to be contributed each time you leave something unfreed. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
No, because you would have set MSG to OFF |
|
Back to top |
|
|
kbrahma
New User
Joined: 08 Oct 2007 Posts: 38 Location: Delhi
|
|
|
|
I guess it's pa-tae-to, pa-ta-to... Some would like to clean up the files in the end of their program and some would clean it up before starting a new one.
I personally like the former one (as I stated earlier), cause in case you need some other TSO messages (and you can't set MSG to OFF) in your program, the "FILE NOT FREED" will just look ugly in the output! hehe... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
So you flick the MSG OFF or ON as required.
I usually clean up my files at both ends of the process |
|
Back to top |
|
|
|