IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting Sequential file attribute


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Wed May 28, 2008 6:17 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed May 28, 2008 6:28 pm
Reply with quote

Did LISTDSI do anything for you?
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Wed May 28, 2008 6:43 pm
Reply with quote

Try this:

Code:
/*rexx*/                                   
address tso                                 
list1 = listdsi("'XXXXX.XXXXX.XXXXXX'")     
say sysused             
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed May 28, 2008 6:56 pm
Reply with quote

why bother...
did You test opening in BROWSE an empty dataset ??

check this thread an You will see why You do not have to test it beforehand

http://www.ibmmainframes.com/viewtopic.php?t=24912&highlight=ispf+browse
Back to top
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu May 29, 2008 12:36 pm
Reply with quote

Yeah,LISTDSI gave me the block count, thanks a lot!!

HOw do we suppress the message generated from the LISTDSI?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 1:15 pm
Reply with quote

OUTTRAP
Back to top
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu May 29, 2008 1:45 pm
Reply with quote

I tried with this
CALL OUTTRAP "ATR."
LISTDS "'" || DSN || "'"

MSG= OUTTRAP('OFF')

Still the mesages are coming
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 2:15 pm
Reply with quote

x = OUTTRAP("ATR.")
ADDRESS TSO "LISTDS ('"DSN"')"
X = OUTTRAP("OFF')
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 2:16 pm
Reply with quote

Corrected
X = OUUTRAP("OFF")
Back to top
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu May 29, 2008 2:44 pm
Reply with quote

This is also not working
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 3:43 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu May 29, 2008 3:43 pm
Reply with quote

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
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu May 29, 2008 5:42 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 6:03 pm
Reply with quote

Should work !!!
How is DSN filled in ?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 6:29 pm
Reply with quote

Also you can submit this online with a "trace i" option at the begining to follow the instructions step by step.
Back to top
View user's profile Send private message
cma rajith

New User


Joined: 28 May 2008
Posts: 30
Location: India

PostPosted: Thu May 29, 2008 6:30 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu May 29, 2008 6:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top