View previous topic :: View next topic
|
Author |
Message |
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Try to add SAY ZERRSM ; SAY ZERRLM right after the LMINIT.
O. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
5 *-* ARG OUDSN SAVDSN
I don't see that you ever supplied a value for either parameter. |
|
Back to top |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
My suggestions:
Add
Code: |
OUDSN = "'"STRIP(OUDSN,"B","'")"'" |
Change the LMINIT to:
Code: |
LMINIT DATAID(ouid) DATASET(&oudsn)" |
O. |
|
Back to top |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
|