Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Usage of LISTDSI in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Usage of LISTDSI in Rexx
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: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 01, 2009 6:35 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 01, 2009 6:43 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 01, 2009 6:53 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 01, 2009 8:07 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Dec 01, 2009 10:13 pm    Post subject: Reply to: Usage of LISTDSI in Rexx
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    Post subject: Reply to: Usage of LISTDSI in Rexx
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Dec 02, 2009 12:20 pm    Post subject: Reply to: Usage of LISTDSI in Rexx
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us