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

How to find syscreate, size, changed date for a pds member


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

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Thu Aug 23, 2007 4:24 pm
Reply with quote

Hi,

I would like to find creation date, last updated date, size & last updated user for a given pds member. Any command that would give me this result?

I tried with listdsi but it gave me info about the pds & not the member. (tht too only syscreate & sysblksize worked).

Thanks...Rabin
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Aug 23, 2007 5:35 pm
Reply with quote

Since you're dealing with a PDS, you ought to be using ISPF Services for what you need. Specifically, you should use the ISPF LMMLIST Service with the LIST and STATS(YES) parameters enabled.
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Thu Aug 23, 2007 6:36 pm
Reply with quote

Hi,

Thanks for your suggestion. Find my code below..

Code:
/* Rexx */                                                             
trace i                                                                 
oudsn='T6201BTX.C6201.JOBINFO.CNTL'                                     
address ISPEXEC                                                         
ARG OUDSN SAVDSN                                                       
"LMINIT DATAID(ouid) DATASET('"oudsn"')"                               
SAY RC                                                                 
IF RC = 0 THEN DO                                                       
  "LMOPEN DATAID("ouid")"                                               
  "LMMLIST DATAID("ouid") OPTION(SAVE) STATS(YES) MEMBER(F3162C04)     
                                  GROUP("SAVDSN")"                     
END                                                                     
say '.'                                                                 
"LMFREE DATAID("ouid")"                                                 
EXIT                                                                   



The output that im getting is RC 8 for LMINIT command..


Code:

 3 *-* oudsn='T6201BTX.C6201.JOBINFO.CNTL'             
   >L>   "T6201BTX.C6201.JOBINFO.CNTL"                 
 4 *-* address ISPEXEC                                 
 5 *-* ARG OUDSN SAVDSN                               
   >>>   ""                                           
   >>>   ""                                           
 6 *-* "LMINIT DATAID(ouid) DATASET('"oudsn"')"       
   >L>   "LMINIT DATAID(ouid) DATASET('"               
   >V>   ""                                           
   >O>   "LMINIT DATAID(ouid) DATASET('"               
   >L>   "')"                                         
   >O>   "LMINIT DATAID(ouid) DATASET('')"             
   +++ RC(8) +++                                       
 7 *-* SAY RC                                         
   >V>   "8"                                           
                                                       
 8 *-* IF RC = 0                                       
   >V>   "8"                                           
   >L>   "0"                                           
   >O>   "0"                                           
13 *-* say '.'                                         
   >L>   "."                                           
                                                       


Any idea where the problem is?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Aug 23, 2007 7:19 pm
Reply with quote

Try to add SAY ZERRSM ; SAY ZERRLM right after the LMINIT.

O.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Aug 23, 2007 7:59 pm
Reply with quote

5 *-* ARG OUDSN SAVDSN

I don't see that you ever supplied a value for either parameter.
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Thu Aug 23, 2007 8:08 pm
Reply with quote

I have given value for oudsn right at the start of the program..

As u said, i missed out for savdsn.. which i have included now in my program.. but im getting the error that the apostrophes is not properly matching...

Code:
 oudsn = 'T6201BTX.C6201.JOBINFO.CNTL'         
 savdsn = 'T3162BTX.T3162.MEMB.INFO.RPRT'     
 address ISPEXEC                               
 ARG OUDSN SAVDSN                             
 "LMINIT DATAID(ouid) DATASET('"oudsn"')"     
 SAY ZERRLM                                   


Code:
   +++ RC(8) +++                                           
 8 *-* SAY ZERRLM                                         
   >V>   "Data set name contains unbalanced apostrophes.   
                                                           
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 23, 2007 8:42 pm
Reply with quote

I found when I was first fighting with Library Management services (LMM...) and learning the proper syntax, I needed to use a combination of SAY's and TRACE. Using TRACE will allow you to see how the LMINIT instruction is being resolved. Thus you would not have to put a SAY oudsn after the SAY ZERRLM.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Aug 23, 2007 8:51 pm
Reply with quote

My best guess?

Clean-up the dataset names (OUDSN SAVDSN) passed through the ARG command:

remove any extra spaces before or after the name.
remove any single or double quotes before or after the name.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Aug 23, 2007 9:12 pm
Reply with quote

My suggestions:

Add
Code:
OUDSN = "'"STRIP(OUDSN,"B","'")"'"


Change the LMINIT to:
Code:
LMINIT DATAID(ouid) DATASET(&oudsn)"



O.
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Fri Aug 24, 2007 10:54 am
Reply with quote

Hi,

Thanks all for your suggestion. Find my modified code below. Though the program ended with RC 0, it gave a message "Invalid List id" & moreover, im not able to locate my output dataset (savdsn). I believe the output dataset would be like this - userid.report.MEMBERS (report is taken from savdsn). Let me know if my understanding is wrong.


Code:
/* Rexx */                                                             
trace i                                                                 
oudsn = 'T6201BTX.C6201.JOBINFO.CNTL'                                   
savdsn = 'REPORT'                                                       
address ISPEXEC                                                         
/*ARG OUDSN SAVDSN*/                                                   
SAY OUDSN                                                               
SAY SAVDSN                                                             
OUDSN = "'"STRIP(OUDSN,"B",'"')"'"                                     
savdsn = "'"STRIP(savdsn,"B",'"')"'"                                   
"LMINIT DATAID(ouid) DATASET(&oudsn)"                                   
                         
SAY ZERRLM                                                             
SAY RC                                                                 
IF RC = 0 THEN DO                                                       
  "LMOPEN DATAID("ouid")"                                               
  "LMMLIST DATAID("ouid") OPTION(SAVE) STATS(YES) MEMBER(F3162C04)     
                                  GROUP(&SAVDSN)"                       
SAY RC                         
END                           
say '.'                       
"LMCLOSE DATAID("ouid")"       
"LMFREE DATAID("ouid")"       
EXIT                           
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Fri Aug 24, 2007 4:25 pm
Reply with quote

Hi all,

I used pattern instead of member in LMMLIST to fix the above problem. Find below the code..

Code:
 /* REXX */                                                 
 /* LMMLIST - LIST A LIBRARY'S MEMBERS */                   
 DATASET = 'T6201BTX.C6201.JOBINFO.CNTL'                     
 ADDRESS ISPEXEC                                             
 TRACE R                                                     
 "LMINIT DATAID(INPUT) DATASET('"DATASET"') ENQ(SHR)"       
 SAY ZERRLM                                                 
 "LMOPEN DATAID("INPUT")"                                   
 SRCHPAT = 'F316223A'                                       
 "LMMLIST DATAID("INPUT") OPTION(SAVE)",                     
     "PATTERN("SRCHPAT") GROUP(LMMLIST)"                     
 SAY RC                                                     
 "LMCLOSE DATAID("INPUT")"                                   
 "LMFREE DATAID("INPUT")"                                   
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top