View previous topic :: View next topic
|
Author |
Message |
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Is there a way to determine when someone has last logged on to the system, as opposed from the time they have last run a job? I was hoping that the LU command would be helpful here, but it seems that both LAST-ACCESS and LAST-CONNECT have the same timestamp.
I need a simple solution, not anything running jobs, as it needs to be incorporated in the logon exec. |
|
Back to top |
|
|
nevilh
Active User
Joined: 01 Sep 2006 Posts: 262
|
|
|
|
You might have a problem with this. By the time you get control RACF would have already updated the LAST-ACCESS and LAST-CONNECT fields.
You might be able to get round this by putting in a TSO Pre-Prompt exit but from the sound of your post this is not an option. Another option would be to allocate a Dummy RACF group for each user and to write a small routine that would connect to it at Logon time(depends on how many users and how friendly the RACF group are). Third option might be to store the date in a Variable |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
Third option might be to store the date in a Variable |
I think the easiest is to store the date to a file. When you logon, read it, remind the user of last logon, then write a new date. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Pedro have you looked at using the UPTUSER field. UPT though the protected step control block (PSCB) |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Mickey, it sounds fairly simple, but the original posters said:
Quote: |
I need a simple solution, |
and it is not clear if your solution is simple enough. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Along the same lines...
RACF provides a DATA field and also a CSDATA field. But you probably need special privileges to setup and use. This might be feasible for use site wide. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
PEDRO, This was a quick attempt I should be close on the offsets
TCB = STORAGE(D2X(540),4) /*PSATOLD IKJTCB */
JSCB = STORAGE(D2X(C2D(TCB)+180),4) /*TCBJSCB EZJSCB */
PSCB = STORAGE(C2X(D2C(JSCB+108)),4) /*JSPSCB IKJPSCB */
UPT = STORAGE(C2X(D2C(PSCB+34)),4) /*PSCBUPT IKJUPT */
UPTU = STORAGE(C2X(D2C(UPT+2)),4) /*UPTUSER FIELD */
ISRDDN
B UPT
CVT 10.? COMMUNICATIONS VECTOR TABLE
TCB CVT?? TASK CONTROL BLOCK
JSCB TCB+B4? JOB/STEP CONTROL BLOCK
PSCB JSCB+108? TSO PROTECTED STEP CONTROL BLOCK
UPT PSCB+34? USER PROFILE TABLE |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
"VPUT (date) PROFILE" ? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Code: |
UPTUSER DS CL10 RESERVED FOR INSTALLATION USE |
Is this data check pointed to RACF? I wrote a tiny command processor that lists its contents, and then stored the current date & time in it. I then logged off and logged back on, and reran the command processor. To my surprise, it appeared to show the date and time I save in it!
So the idea of using UPTUSER might work! |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Steve, I am not aware off RACF doing anything with the UPTUSER field. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Well, I wasn't either, though there is nothing to say it isn't saved. It is known parts of the UPT are preserved. I just did a quick and dirty test using a spare LOGON. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Mickeydusaor wrote: |
PEDRO, This was a quick attempt I should be close on the offsets
TCB = STORAGE(D2X(540),4) /*PSATOLD IKJTCB */
JSCB = STORAGE(D2X(C2D(TCB)+180),4) /*TCBJSCB EZJSCB */
PSCB = STORAGE(C2X(D2C(JSCB+108)),4) /*JSPSCB IKJPSCB */
UPT = STORAGE(C2X(D2C(PSCB+34)),4) /*PSCBUPT IKJUPT */
UPTU = STORAGE(C2X(D2C(UPT+2)),4) /*UPTUSER FIELD */
|
Doesn't work,
Code: |
7 +++ PSCB = STORAGE(C2X(D2C(JSCB+108)),4) /*JSPSCB IKJPSCB */
IRX0041I Error running ERAPS, line 7: Bad arithmetic conversion |
Not been able to figure out why. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Robert - try
PSCB = STORAGE(C2X(D2C(JSCB+264)),4) /*JSPSCB IKJPSCB */
264 = X'108'
Also
UPT = STORAGE(C2X(D2C(PSCB+52)),4) /*PSCBUPT IKJUPT */
52 = X'34' |
|
Back to top |
|
|
nevilh
Active User
Joined: 01 Sep 2006 Posts: 262
|
|
|
|
If this code is to be used in production I personally would not use the UPTUSER. The UPTUSER is stored in the user Address Space and it is not unknown that this area is modified by user applications. A second drawback is that this field is only written to UADS/Racf at Logoff time. If the user does not Logoff cleanly it is a lottery if the data will be stored or not. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
nevilh wrote: |
If this code is to be used in production I personally would not use the UPTUSER. The UPTUSER is stored in the user Address Space and it is not unknown that this area is modified by user applications. A second drawback is that this field is only written to UADS/Racf at Logoff time. If the user does not Logoff cleanly it is a lottery if the data will be stored or not. |
All too true. But other data in the UPT, such as the data set prefix, is saved with little apparent trouble. You counter this by extensive data validation. If the data isn't valid, you don't use it. Let's face it: last LOGON date / time is hardly vital!
A related problem is the area being used by another process. Here, again, you can establish controls. |
|
Back to top |
|
|
|