Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think the site is just incredible....I am learning more here than anywhere else before and am looking forward to being able to help someone .... this is my idea of what the Internet is supposed to do..."

Geography

Where in the world do Tek-Tips members come from?

How to find updated members

rajesh082 (Programmer)
18 Jan 08 6:30
Hi All,

I have a small requirement...
I am writing lot of Members in a PDS with some basic fields in Batch mode.

Now on a future run I want to check how many members of this PDS have been edited.

I tried using LISTDSI SYSUPDATED, but this is giving me Yes for all the members, even for the members which are totally empty.

X = listdsi(PDS"("Mem")")

Since the Members created in Batch mode have the Job name as their creator, another way of checking is if the Creator id is anything else than the Job name, How can I accomplish this.

Answers to any of the either of 2 queries will be appreciated.
rexxhead (Programmer)
18 Jan 08 8:52

There's no 100%-guaranteed way to do this other than by going to SMF (and even that has its limits), but you can get close.

You say that "Members created in Batch mode have the Job name as their creator" so I presume the batch process is using LMMSTATS to insert the 'last changed userid'.  Any user who edits such a member must either blank that datapoint by turning STATS off or leave their own userid in its place.

LMMFIND ... STATS(YES) will bring back all the collected datapoints and you can verify that the userid is changed or not.

Beware:  a sophisticated user can easily thwart that protocol.

Frank Clarke
Support the Troops:
 -- Bring them home.
http://www.RonPaul2008.com

rajesh082 (Programmer)
18 Jan 08 9:42
Hi Frank,

Thanks for your reply.

"There's no 100%-guaranteed way to do this other than by going to SMF (and even that has its limits), but you can get close."

I had already Got this when I was scanning previous posts on this, and saw the same reply by you on one of the posts.

My Question was Why is the SYSUPDATED giving me a YES for every member. Does SYSUPDATED variable give me the status for the PDS rather than the member?

Yeah, you are correct in assuming that I want to compare the USERIDS against the Member (as seen in ISPF 3.4 Panel). Which function can return me this user id in my Rexx Program.

Once again thanks. I dont need the code, I am just trying to learn use Rexx in sync with TSO/ISPF services. Any kind of pointers or help would actually get me going in the right direction.

Thanks.

RxUsr (Programmer)
18 Jan 08 10:22
Here is a routine that uses LMMLIST to get the mambers of a PDS.

/********************REXX***********************/
PDSname = 'AAAAAAAA.REXX.PDS'
MemList. = ''
/**********************************************************/
/* Get dataid for data set and issue LMOPEN */
/**********************************************************/
Address ISPEXEC
ISPEXEC "LMINIT DATAID(DatID) DATASET('"PDSname"') ENQ(SHR)"
IF rc <> 0 then
Call Exit8 'ERROR initializing PDS' PDSname 'rc='rc
ISPEXEC "LMOPEN DATAID("DatID") OPTION(INPUT)"
IF rc <> 0 then
Call Exit8 'ERROR Opening PDS' PDSname 'rc='rc
/**********************************************************/
/* Loop through all members in the PDS */
/**********************************************************/
Membr = ' '
Do i = 1 by 1
ISPEXEC "LMMLIST DATAID("DatID") OPTION(LIST) MEMBER(MEMBR) STATS(YES)"
If rc <> 0 Then leave
If ZLMTIME <> '' then Mtime = ZLMTIME":"ZLMSEC
else Mtime = copies(' ',8)
MemList.i = Membr ZLC4DATE ZLM4DATE Mtime ZLVERS ZLMOD ZLUSER
End
MemList.0 = i - 1
/**********************************************************/
/* Free the member list and close the dataid for the PDS. */
/**********************************************************/
ISPEXEC "LMMLIST DATAID("DatID") OPTION(FREE)"
ISPEXEC "LMCLOSE DATAID("DatID")"
/**********************************************************/
/* Display the member list */
/**********************************************************/
Do i = 1 to MemList.0 /* Do i = 1 to 10 to limit the display*/
Say MemList.i
End
Return

/* ********** Error Exit ********** */
Exit8:
Arg ErrMsg
Say Errmsg
Exit 08
/* */
rexxhead (Programmer)
18 Jan 08 11:27
RxUsr --

You should avoid doing

CODE

ISPEXEC "LMMLIST DATAID("DatID") OPTION(FREE)"

You're probably in address TSO when you do this, so this whole command gets handed to IKJEFT01 which dispatches a fresh copy of ISPEXEC to handle the quoted string.

Since you must already have started an ISPEXEC environment it is more efficient to

CODE

address ISPEXEC "LMMLIST DATAID("DatID") OPTION(FREE)"
which uses the currently-existing ISPEXEC to handle the service.

Frank Clarke
Support the Troops:
 -- Bring them home.
http://www.RonPaul2008.com

rajesh082 (Programmer)
18 Jan 08 11:56
My Question was Why is the SYSUPDATED giving me a YES for every member. Does SYSUPDATED variable give me the status for the PDS rather than the member?

Can somebody please address this Question?
rexxhead (Programmer)
18 Jan 08 13:31

Yes, SYSUPDATED refers to the dataset, not a particular member.

Frank Clarke
Support the Troops:
 -- Bring them home.
http://www.RonPaul2008.com

RxUsr (Programmer)
18 Jan 08 13:45
rexxhead --

I thought line 7 (Address ISPEXEC) would keep me in the ISPEXEC environment until another Address instruction was issued. Is it a better parctice to use Address every time?
I omit it just to save space on the line and avoid continuations. I will add it in the future.

thanks,
RxUsr

The Ref. manual says SYSUPDATED:
YES - Data set has been updated
NO - Data set has not been updated

Data set would be the PDS not individual members.
rexxhead (Programmer)
18 Jan 08 15:01
Didn't see l.7, but that only makes it worse !

In that case, you're not in address TSO, you're in address ISPEXEC, so when you issue

CODE

ISPEXEC "LMMFIND ..."
that's passed to ISPEXEC which says "ISPEXEC?  Don't know what that means.  Hey, TSO, here's a command; handle it for me, OK?"

Now TSO gets it and starts a fresh ISPEXEC, etc., and when it's finished finally hands control back to the original ISPEXEC task.

Far better to lump all your <whatever> into a subroutine:

CODE

ISPF_STUFF:
   address ISPEXEC
   "LMINIT ..."
   ...
   "LMFREE ..."
return

An 'address' specification issued in a subroutine reverts when that subr returns, so if your main code runs in address TSO, you can set it and forget it.

Frank Clarke
Support the Troops:
 -- Bring them home.
http://www.RonPaul2008.com

rajesh082 (Programmer)
23 Jan 08 6:00
The LMFIND service resets the userid against the member. Is there any way to stop this?

Address ISPEXEC                                     
"LMINIT DATAID(DatID) DATASET('"Var2"') ENQ(SHR)"   
"LMOPEN DATAID("DatID") OPTION(INPUT)"
"LMMFIND DATAID("DatID") MEMBER("Mem") STATS(YES)"
MemStat = Mem ZLC4DATE ZLM4DATE Mtime ZLVERS ZLMOD ZLUSER

When the code has run the user name against the member is reset to my name. How can I avoid this?
RxUsr (Programmer)
23 Jan 08 7:16
Did you try LMMLIST?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close