?
Solved

Does the AS/400 keep a log of when users sign on and sign off?

Posted on 2006-03-27
20
Medium Priority
?
1,056 Views
Last Modified: 2008-01-09
I need to produce a report showing when users sign on and off by date and time.

Thanks,
Phil
0
Comment
Question by:pipster1
  • 7
  • 7
  • 4
18 Comments
 
LVL 13

Expert Comment

by:_b_h
ID: 16306621
Hi, Phil
1) By default, you can use to the system history log to get a listing like this:

Job 080894/BARRY/QPADEV000B started on 03/28/06 at 18:08:41 in subsystem QINTER
Job 080894/BHARPER/QPADEV000B ended on 03/28/06 at 19:08:57; 17 seconds used;

Use the display log (DSPLOG) command like this:
DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF1124 CPF1164)

The problem is that you will get batch jobs and interactive jobs. You could dump the report to a spooled file, copy it to a physical file of length 132, and try to query it.

2) Job accounting can be turned on by:
-create a journal receiver
-create the job accounting journal QACGJRN and attach the receiver
-change the QACGLVL system value to *JOB
You can then display the entries by:
-create a duplicate of file QJBACG from QSYS to yourlib
-use display journal command to dump entries:
DSPJRN JRN(QACGJRN) FROMTIME(031406 080000) TOTIME(032106 170000) ENTTYP(JB) OUTPUT(*OUTFILE) OUTFILE(yourlib/QAJBACG)
You can then query the file to get a report in the format required.

Please post back if more details are needed.
Barry
0
 
LVL 27

Expert Comment

by:tliotta
ID: 16314110
Phil:

It's easy enough to track job start and end times as Barry shows. This could be your best choice. Basic QHST is the simplest; the accounting journal is more difficult.

One difficulty is determining whether or not a job start is due to a "sign on" or it's simply a batch job that happens to be named the same as a workstation device. This is harder to do if the job has ended and hasn't created any spooled file that would cause the the job information to stay in the system. Also, accounting journal management _might_ be an issue.

Also, secondary and group jobs can really mess up the logic for determining "sign on and off" times.

One possibility is the QIBM_QWT_JOBNOTIFY (Job Notification) exit point. This can do the job of tracking by placing entries in a data queue. The entries include most useful info about the jobs that start and end in the subsystems you want to track, e.g., QINTER.

Data queue entries could be retrieved live by a never-ending program or retrieved in a batch every night. The entries could be then written into a database however you wish.

A live NEP gives the chance to access job info almost as soon as the sign on occurs.

Tom
0
 

Author Comment

by:pipster1
ID: 16323556
Tom,
 I like your idea about the data queues. I'm not really familiar with exit points. Could you cite an example of how
the program would look, and how the data would be written to the data queue.

Thanks,

Phil
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 27

Expert Comment

by:tliotta
ID: 16325606
Phil:

Not sure how much time I have. Barry or Dave might have samples handy. Anybody else is perfectly welcome to take this if I can't get to it soon.

Data queues are really simple once you see them working a time or two. They can be thought of as files where the record is automatically deleted as soon as you read it. You call an API telling it what data queue to read and the API returns the next record in its return buffer. There is no record format, so you take substrings of that buffer or you declare an overlay that defines a data structure.

One API reads entries from the queue; another API sends entries to the queue. You can send and receive entries all on your own, or you can interact with system functions that might send or receive entries. The job notification exit point is an example of a system function that sends entries to a queue. Your program would receive those entries.

That's the really really short version of the concept. More if I get to it.

Tom
0
 

Author Comment

by:pipster1
ID: 16325803
I think I understand how to do the data queues. I found an old program I'd done a while back
so I've got that covered.

I just don't have any experience on exit points.

Anyone who could help would be appreciated.

Thanks,

Phil
0
 

Author Comment

by:pipster1
ID: 16325816
I've also increased the point value from 250 to 500.

Thanks,

Phil
0
 
LVL 13

Expert Comment

by:_b_h
ID: 16325954
Check out the infocenter at:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp
and search for the exit point name:
QIBM_QWT_JOBNOTIFY
This will show you the format of the data queue entries, how entries are added to the data queue, how to add the data queue to the exit point (instead of an exit program), etc.

Barry
0
 

Author Comment

by:pipster1
ID: 16326026
I'm using V4R3M0 if you can believe it. Will this still work?

Thanks,

Phil
0
 
LVL 13

Expert Comment

by:_b_h
ID: 16326181
I just checked my V4R3 system using Work with Registration Info (WRKREGINF) and the exit point QIBM_QWT_JOBNOTIFY is there.
Barry
0
 
LVL 13

Expert Comment

by:_b_h
ID: 16326273
If you go to the V4R3 library:
http://publib.boulder.ibm.com/pubs/html/as400/online/v4r3eng.htm
and look for the Work Management APIs V4R3 book which contains info on the exit point.
Barry
0
 
LVL 13

Expert Comment

by:_b_h
ID: 16326508
One more thing....
You add the data queue using the Add Exit Program command:
ADDEXITPGM EXITPNT(QIBM_QWT_JOBNOTIFY) FORMAT(NTFY0100) PGMNBR(1) PGM(yourlib/data-queue)
0
 
LVL 27

Expert Comment

by:tliotta
ID: 16328427
Yeah, it looks a little odd to put the data queue name into the PGM() parm, but the parm is really nothing more than a qualified object name. The system can use the name as a data queue name if it wants to.

If I were IBM, I might have extended the ADDEXITPGM command rather than reuse a misleading parm name. But I suppose that's why they make the big bucks.

Tom
0
 

Author Comment

by:pipster1
ID: 16332354
Barry,

In the Work Management API for QIBM_QWT_JOBNOTIFY
I found this:

2.4.3 Program Data


When you register the data queue, the following is required for the program data.

   Offset                        Type                            Field                                        
 
   Dec        Hex
 
   0           0                CHAR(4)                         Notification type
   4           4                CHAR(10)                       Subsystem description                        
  14          E                CHAR(10)                       Subsystem description library                
 
What is 'registering' the data que?

Thanks,

Phil

0
 
LVL 13

Expert Comment

by:_b_h
ID: 16333836
To register the data queue, use the ADDEXITPGM command above:
ADDEXITPGM EXITPNT(QIBM_QWT_JOBNOTIFY) FORMAT(NTFY0100) PGMNBR(1) PGM(yourlib/data-queue)

Barry
0
 

Author Comment

by:pipster1
ID: 16333914
ok, thanks

Phil
0
 

Author Comment

by:pipster1
ID: 16333926
How do I tell the exit point which sub-system I want to monitor?

Phil
0
 
LVL 13

Accepted Solution

by:
_b_h earned 1000 total points
ID: 16334080
I think it monitors all jobs and your program has to filter by subsystem.
Barry
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 1000 total points
ID: 16335399
Phil:

Note that the ADDEXITPGM command has additional parms that can be seen when you prompt the command and then press <F10>. The parm you want is at the end -- PGMDTA().

Tom
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Social messanging services like WhatsApp and Facebook can help businesses in ways that many owners don't even imagine, giving new opportunities to connect with customers. Discover some of the most innovative things they can do for your company.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question