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

Usage of LISTDSI in Rexx


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

New User


Joined: 26 Feb 2008
Posts: 2
Location: US

PostPosted: Tue Dec 01, 2009 6:31 pm
Reply with quote

Hi. I am writing a simple rexx code to display dataset attributes.
X=LISTDSI(PROG1.INPUT)
EXIT

It is returning code 0 but with no results.
If i give SAY X before EXIT keyword it will return code 16.

PROG1.INPUT is a simple PS with few records.

Can anyone of you suggest how to get dataset attributes displayed.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 01, 2009 6:35 pm
Reply with quote

The reason it gives a return 16 is that the syntax is incorrect
Back to top
View user's profile Send private message
sjvidya

New User


Joined: 26 Feb 2008
Posts: 2
Location: US

PostPosted: Tue Dec 01, 2009 6:40 pm
Reply with quote

But if i give just
X=LISTDSI(PROG1.INPUT)
EXIT
It is returning code 0 but without displaying dataset attributes.

What is the error. Even if i put quotes for dataset name, it will return 0 but with no results. Please suggest.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 01, 2009 6:40 pm
Reply with quote

This is LISTDS, but should help you:

Code:

X = OUTTRAP("LDS.")
ADDRESS TSO "LISTDS ('YOUR.PDS(MEMBER)') MEMBERS"
Do I = 1 To LDS.0
  If Index(LDS.I,'--MEMBER---TTR') > 0 Then
    Do
      SAY 'MEMBER FOUND'
      Leave I
    End
End
X = OUTTRAP("OFF")
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 01, 2009 6:43 pm
Reply with quote

Have you actually read the manual to see the correct syntax and usage of LISTDSI

If you had, you would know what the problem is

Please click HERE to read all about it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 01, 2009 6:45 pm
Reply with quote

Read the Manual? when all he wants is someone to give him the answer?

Expat,
he is so lazy that if he wanted to start a family, he would go find a pregnant woman.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 01, 2009 6:53 pm
Reply with quote

Dick, Nice one, I'll have to remember that icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 01, 2009 8:07 pm
Reply with quote

dbzTHEdinosauer wrote:
Read the Manual? when all he wants is someone to give him the answer?

Expat,
he is so lazy that if he wanted to start a family, he would go find a pregnant woman.


Its getting better and better to enlighten my day.
Thanks guys.
Back to top
View user's profile Send private message
ananth86

New User


Joined: 10 Jun 2009
Posts: 59
Location: Hyderabad

PostPosted: Tue Dec 01, 2009 8:53 pm
Reply with quote

Expat, ur link is really useful. Thanks a lot

Vidya, try this below code. Its very simple. Refer Expat's link to customise the attributes to be dispalyed

Code:

/*REXX*/                                                     
X = LISTDSI("'your.dataset'")                           
         SAY 'FUNCTION CODE FROM LISTDSI IS: ' X             
         SAY 'THE DATA SET NAME IS: ' SYSDSNAME             
         SAY 'THE DEVICE UNIT VOLUME RESIDES IS:' SYSUNIT   
         SAY 'THE RECORD FORMAT IS: ' SYSRECFM               
         SAY 'THE DATASET ORG IS: ' SYSDORG                 
         SAY 'THE LOGICAL RECORD LENGTH IS: ' SYSLRECL       
         SAY 'THE BLOCK SIZE IS: ' SYSBLKSIZE               
         SAY 'THE ALLOCATION IN SPACE UNITS IS: ' SYSUNITS   
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2545
Location: Silicon Valley

PostPosted: Tue Dec 01, 2009 10:13 pm
Reply with quote

Quote:
a simple rexx code to display dataset attributes.


I do not see where anyone actually said this: the LISTDSI built-in function does not display dataset attributes. It only retrieves them for use in the rexx program.
Back to top
View user's profile Send private message
nemo_budd

New User


Joined: 30 Mar 2008
Posts: 7
Location: Pune

PostPosted: Wed Dec 02, 2009 12:17 pm
Reply with quote

Hi,

I need the creator/modified user id of the dataset along with the other statistics. I have verified that "LISTDSI" command is not returning the user id. Is there any other way to retrieve that, any direction helps.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 02, 2009 12:20 pm
Reply with quote

the creator modifier info is only available by processing the SMF data
ask Your storage support about it
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top