View previous topic :: View next topic
|
Author |
Message |
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Hi all,
How to check in rexx for file attributes,especially block count!!
My requirement is to find out whether the file is empty or not before opening it in browse mode.LISTDS is not giving block count.
If somehow I can getthe block count in the current utilization part as in the attachement, with that I can decide whether the file is empty or not.
Thanks in advance,
Ceema Rajith |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Ganesh.Deokar
New User
Joined: 30 Sep 2005 Posts: 26 Location: Buffalo,NY
|
|
|
|
Try this:
Code: |
/*rexx*/
address tso
list1 = listdsi("'XXXXX.XXXXX.XXXXXX'")
say sysused |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
Yeah,LISTDSI gave me the block count, thanks a lot!!
HOw do we suppress the message generated from the LISTDSI? |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
OUTTRAP |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
I tried with this
CALL OUTTRAP "ATR."
LISTDS "'" || DSN || "'"
MSG= OUTTRAP('OFF')
Still the mesages are coming |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
x = OUTTRAP("ATR.")
ADDRESS TSO "LISTDS ('"DSN"')"
X = OUTTRAP("OFF') |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Corrected
X = OUUTRAP("OFF") |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
This is also not working |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Ok now from the start.
First
Quote: |
Yeah,LISTDSI gave me the block count, thanks a lot!! |
I am not sure it did, and I am not sure what you exactly mean by "block count".
Quote: |
HOw do we suppress the message generated from the LISTDSI? |
You cannot ask to LISTDSI to not generate message and as well to ask to receive information from it !!!
So give us the kind of message you want to avoid.
Also, do you run this in background or in foreground ?
Finally do you just want to know if a file is empty or not? If so, LISTDSI is not convenient.
Use IDCAMS, or EXECIO and test the return code, ...
Please clarify
Cheers
Pierre |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
cma rajith wrote: |
This is also not working |
Perhaps, just maybe if you follow the instructions below
Post your code, and the messages that you wish to dispose of
then we might actually be able to help you. |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
My code is
FATTR = LISTDSI("'"DSN"'")
IF FATTR == 0 THEN
IF SYSUSED == 0 THEN
SAY "EMPTY FILE"
ELSE
DSNCAT = 'YES'
Here I'm checking for a empty datset..so in the screen i'm expecting only 'EMPTY FILE' but what is comming
"IKJ56712I INVALID KEYWORD, "AX.IOLDI.G.DATA.AUSTRIA.G0146V00"
EMPTY FILE
Please guide me to avoid the first line from the screen |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Should work !!!
How is DSN filled in ? |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Also you can submit this online with a "trace i" option at the begining to follow the instructions step by step. |
|
Back to top |
|
|
cma rajith
New User
Joined: 28 May 2008 Posts: 30 Location: India
|
|
|
|
DSN is AX.IOLDI.G.DATA.AUSTRIA.G0146V00 , it filled properly.
My problem is the message "IKJ56712I INVALID KEYWORD, "AX.IOLDI.G.DATA.AUSTRIA.G0146V00"
which is generated by LISTDSI.I want the customized display only |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Yes, but something is running wrong. Try the trace option : it will show you all info.
Because you cannot avoid message IKJ type.
You did not respons to that : batch or online?
Pierre |
|
Back to top |
|
|
|