Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
List of PDS members from C/C++

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics
Author Message
XOpen

New User


Joined: 19 Mar 2008
Posts: 25
Location: Russia

PostPosted: Wed Mar 26, 2008 5:02 pm    Post subject: List of PDS members from C/C++
Reply with quote

Is there a native way to get the subj ? (API?)
instead of calling TSO LISTDS and parsing the output ?
Back to top
View user's profile Send private message
References
PostPosted: Wed Mar 26, 2008 5:02 pm    Post subject: Re: List of PDS members from C/C++ Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 1788
Location: italy

PostPosted: Wed Mar 26, 2008 5:05 pm    Post subject: Reply to: List of PDS members from C/C++
Reply with quote

just read the directory as a PS dataset and decode the member info
lots of samples around the net

here is a rexx sample ( not mine, bit I think that Doug Nadel will not mind )
posted under copyright assumption/declaration of fair use
Code:
/*Rexx routine to read a pds directory and show the ispf stats     */
/*     non load module only.                                       */
/* Author: Doug Nadel - 3/31/2001 */
Parse Upper Arg dsname .
If 0<>listdsi(dsname) Then
  Do
    Say 'Data set 'dsname' not allocated'
    Exit
  End
If 'PO'<>substr(sysdsorg,1,2) Then
  Do
    Say 'Data set 'dsname' is not a pds'
    Exit
  End
Address tso
'ALLOC F(AREAD) DS('dsname') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)'
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'
'FREE F(AREAD)'
Do blocknum = 1 to dirs.0
  block=dirs.blocknum
  Parse Var dirs.blocknum bl 3 block
  block=substr(block,1,c2d(bl)-2)
  Do While block<>''
    Parse Var block name 9 ttr 12 c 13 block
    c=c2d(bitand(c,'1f'x))
    If name='FFFFFFFFFFFFFFFF'x Then
      Leave blocknum
    stats=''
    If c=15 & sysrecfm \= 'U' Then
      stats=decodestats(substr(block,1,30))
    Say name stats
    block=delstr(block,1,c*2)
  End
End
Exit
decodestats:  Procedure  /* decode the directory */
direntry=Arg(1)
  Parse Var direntry,
    vv 2 mm 3 flags 4 ss 5 crecc 6 crdate 9 modcc 10 moddate 13 hh,
    14 tm 15 lines 17 init 19 mod 21 userid 28 .
  Parse Value c2x(crdate)  with cyy 3 cjjj 6 .
  Parse Value c2x(moddate) with myy 3 mjjj 6 .
  out=leftd(vv)'.'leftd(mm)                       /* Vv.Mm         */
  out=out 19+c2x(crecc)cyy'.'cjjj                 /* Create date   */
  out=out 19+c2x(modcc)myy'.'mjjj                 /* Mod date      */
  out=out leftx(hh)':'leftx(tm)':'leftx(ss)       /* mod time      */
  out=out right(c2d(lines),5)                     /* Lines         */
  out=out right(c2d(init),5)                      /* Initial lines */
  out=out right(c2d(mod),5)                       /* Mod lines     */
  out=out userid                                  /* User id       */
  If bitand(flags,'80'x) = '80'x Then
    out=out '(SCLM)'                              /* Saved by SCLM */
  Return out
leftd: return right(c2d(arg(1)),2,'0')
leftx: return right(c2x(arg(1)),2,'0')


should be easy for a C/C++ expert to transpose
Back to top
View user's profile Send private message
XOpen

New User


Joined: 19 Mar 2008
Posts: 25
Location: Russia

PostPosted: Wed Mar 26, 2008 7:49 pm    Post subject:
Reply with quote

Thanks, will try. I have heard, that I can read it as PS, but didn't find a format of PDS. Could you say, in which book it's described ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1