Z-LOGS

This document covers the following topics:


Description

Return information about unsuccessful logon attempts to a cabinet.

The Cabinet-table returns only those cabinets for which an unsuccessful logon attempt occurred.

This subprogram can be invoked by different types of users. Depending on the type of user, the following applies:

  • Administrator
    Can return all unsuccessful logon attempts for all cabinets.

  • Any Other User
    Can only return the unsuccessful logon attempts for their cabinets. In this case, the parameters Cabinet and Logon-by-cabinet-name must be the same. Otherwise, return code 15 is issued.

The timezone is always GMT. Other timezones are not considered.

This subprogram should be invoked iteratively until the return code 77 indicates the end of the list.

Parameters

Parameter Format In Out Remarks
Return-code N2   X  
Cabinet A8 R   Any user can invoke this subprogram.
Password A8 R   The password of the above cabinet.
Logon-by-cabinet-name A8 R*   The name of the cabinet that is to be checked for unsuccessful logon attempts to other cabinets. Either Logon-by-cabinet-name or Logon-by-cabinet-ISN, not both.
Logon-by-cabinet-ISN P10 R*   The ISN of the cabinet that is to be checked for unsuccessful logon attempts to other cabinets. Either Logon-by-cabinet-ISN or Logon-by-cabinet-name, not both.
Logon-by-cabinet-status N1   X The status of the cabinet from which unsuccessful logon attempts occurred. 1 = the cabinet is locked, 0 = the cabinet is not locked.
Lock-default N1   X The number of unsuccessful logon attempts (1-9) after which the cabinet is locked. 0 means that unsuccessful logon attempts are ignored.
Logon-to-cabinet-start-name A8 O   Start value. The name of the cabinet that is to be checked for unsuccessful logon attempts from other cabinets. If you do not specify a start value, a list of all cabinets for which unsuccessful logon attempts occurred is returned.
Number N2 O   The maximum number of cabinets that are returned with each call. When you do not specify a value, or when you specify a value greater than 20, the default value 20 is used.
Cabinet-table (20)
  Logon-to-cabinet-name A8   X The name of the cabinet.
  Logon-attempts N4   X The number of unsuccessful logon attempts. The value is taken from the system file (1-9999).
  Logon-attempt-date N8   X The date of the last unsuccessful logon attempt.
  Logon-attempt-time N4   X The time of the last unsuccessful logon attempt.
Work-parameter A8     For internal use. See The Work Parameter.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
03 Password incorrect
04 ISN not found
08 Supply either Logon-by-cabinet-ISN or Logon-by-cabinet-name, not both
09 ISN does not point to correct object
15 Invalid administrator status
77 End of list
91 Either Logon-by-cabinet-name or Logon-by-cabinet-ISN must be supplied
92 Logon-by-cabinet-name is not valid

Subprograms

Z-120
Z-122
Z-123
Z-705
Z-1200&0

Example

0010 *
0020 * Example program to get user log information about unsuccessful
0030 * logon attempts from a specific cabinet to others cabinets
0040 *
0050 DEFINE DATA
0060 LOCAL
0070 1 RETURN-CODE                (N2)
0080 1 CABINET                    (A8)
0090 1 PASSWORD                   (A8)
0100 1 LOGON-BY-CABINET-NAME      (A8)
0110 1 LOGON-BY-CABINET-ISN       (P10)
0120 1 LOGON-BY-CABINET-STATUS    (N1)
0130 1 LOCK-DEFAULT               (N1)
0140 1 LOGON-TO-CABINET-START-NAME(A8)
0150 1 NUMBER                     (N2)
0160 1 CABINET-TABLE (20)
0170   2 LOGON-TO-CABINET-NAME    (A8)
0180   2 LOGON-ATTEMPTS           (N4)
0190   2 LOGON-ATTEMPT-DATE       (N8)
0200   2 LOGON-ATTEMPT-TIME       (N4)
0210 1 WORK-PARAMETER             (A8)
0220 *
0230 1 #INX                       (N2)
0240 1 #LAST-DATE                 (N8)
0250 1 REDEFINE #LAST-DATE
0260   2 #LAST-YEAR               (A4)
0270   2 #LAST-MONTH              (A2)
0280   2 #LAST-DAY                (A2)
0290 1 #DATE                      (A10)
0300 1 #LAST-TIME                 (N4)
0310 1 REDEFINE #LAST-TIME
0320   2 #LAST-HOUR               (A2)
0330   2 #LAST-MIN                (A2)
0340 1 #TIME                      (A5)
0350 *
0360 END-DEFINE
0370 *
0380 MOVE 'CABINET'  TO CABINET
0390 MOVE 'PASSWORD' TO PASSWORD
0400 MOVE 'CABNAME'  TO LOGON-BY-CABINET-NAME
0410 MOVE 20         TO NUMBER
0420 RESET RETURN-CODE LOGON-BY-CABINET-ISN
0430 *
0440 REPEAT UNTIL RETURN-CODE NE 0
0450   CALLNAT 'Z-LOGS'  RETURN-CODE
0460                     CABINET
0470                     PASSWORD
0480                     LOGON-BY-CABINET-NAME
0490                     LOGON-BY-CABINET-ISN
0500                     LOGON-BY-CABINET-STATUS
0510                     LOCK-DEFAULT
0520                     LOGON-TO-CABINET-START-NAME
0530                     NUMBER
0540                     CABINET-TABLE(*)
0550                     WORK-PARAMETER
0560 *
0570   IF RETURN-CODE EQ 0  OR  RETURN-CODE EQ 77
0580     FOR #INX 1 TO NUMBER
0590       IF LOGON-TO-CABINET-NAME(#INX) EQ ' '
0600         ESCAPE BOTTOM
0610       END-IF
0620 *
0630       NEWPAGE
0640       WRITE NOTITLE NOHDR (SG=OFF ZP=OFF AD=L)            / /
0650             'By cabinet name    ' LOGON-BY-CABINET-NAME (AD=IO) /
0660 *
0670       IF LOGON-BY-CABINET-STATUS EQ 0
0680         WRITE 'Default lock number' LOCK-DEFAULT          /
0690       ELSE
0700         WRITE 'Cabinet' LOGON-BY-CABINET-NAME' is locked'  /
0710               'Default lock number' LOCK-DEFAULT          /
0720       END-IF
0730 *
0740       MOVE LOGON-ATTEMPT-DATE(#INX) TO #LAST-DATE
0750       COMPRESS #LAST-YEAR '-' #LAST-MONTH '-' #LAST-DAY
0760                                          INTO  #DATE  LEAVING NO SPACE
0770       MOVE LOGON-ATTEMPT-TIME(#INX) TO #LAST-TIME
0780       COMPRESS #LAST-HOUR ':' #LAST-MIN  INTO  #TIME  LEAVING NO SPACE
0790 *
0800       WRITE 'To cabinet name ' LOGON-TO-CABINET-NAME(#INX)/
0810             'Logon attempts  ' LOGON-ATTEMPTS(#INX)    /
0820             'Date of last attempt ' #DATE                   /
0830             'Time of last attempt ' #TIME                   / /
0840     END-FOR
0850   END-IF
0860 *
0870   IF RETURN-CODE NE 0
0880     WRITE 'Return code' RETURN-CODE (AD=IO)
0890   END-IF
0900 END-REPEAT
0910 *
0920 END