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

Last logon vs last use


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Nov 16, 2014 3:46 pm
Reply with quote

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
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Sun Nov 16, 2014 6:59 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Nov 18, 2014 2:04 am
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Nov 21, 2014 1:15 am
Reply with quote

Pedro have you looked at using the UPTUSER field. UPT though the protected step control block (PSCB)
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Nov 21, 2014 2:59 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Nov 21, 2014 3:28 am
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Nov 21, 2014 4:27 am
Reply with quote

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
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 52
Location: UK

PostPosted: Fri Nov 21, 2014 12:48 pm
Reply with quote

"VPUT (date) PROFILE" ?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Nov 21, 2014 1:54 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Nov 21, 2014 8:05 pm
Reply with quote

Steve, I am not aware off RACF doing anything with the UPTUSER field.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Nov 21, 2014 9:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2014 10:13 pm
Reply with quote

IMO worth looking at
publib.boulder.ibm.com/infocenter/ieduasst/stgv1r0/topic/com.ibm.iea.zos/zos/1.10/Security/IEA-V1R10-RACF-CustomFields.pdf
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat Nov 22, 2014 7:51 pm
Reply with quote

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. icon_sad.gif
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat Nov 22, 2014 10:16 pm
Reply with quote

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
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Mon Nov 24, 2014 7:28 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Mon Nov 24, 2014 10:25 pm
Reply with quote

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
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Execute REXX on logon with ISPF CLIST & REXX 3
No new posts Alter User LOGON Script Parameters CLIST & REXX 11
No new posts How to change the logon screen info o... TSO/ISPF 5
No new posts TSO Logon Failing - Acount Not matching TSO/ISPF 1
No new posts Execution of Macro at Command Line on... TSO/ISPF 9
Search our Forums:

Back to Top