TAA Tools
CHGSGNDAT       CHANGE SIGNON DATE                     TAASEFH

The Change Signon  Date command is intended  for the case where  a user
profile  swap has occurred  and the user  profile should be  updated so
that  the current  date and  time becomes  the signon  date/time value.
CHGSGNDAT may  also  be  used without  a  profile  swap to  update  the
current  profile if  an option  is specified.   CHGSGNDAT  may  only be
used in a CL program.  The QSYCHGPR API is used.

The  SWPUSRPRF TAA  command may  be used  to swap  to a  different user
profile if  the  current  user  has  *USE authority  to  the  new  user
profile.   This  would be  typical of  a  program which  has adopted  a
significant  amount  of  authority.    SWPUSRPRF  ensures the  original
profile will be swapped  back to after a  command (including a CALL  to
a program) has  been run.  The CMD  parameter for SWPUSRPRF may  not be
CHGSGNDAT.   To run CHGSGNDAT,  place the command  in a CL  program and
use a CALL as the CMD parameter of SWPUSRPRF.

The QSYGETPH and QWTSETP APIs may also be used.

A typical command after a swap of the profile would be:

            CHGSGNDAT

The  current  user  profile  would  be  updated  to  change  the signon
date/time to be the current date/time.

Using CHGSGNDAT for another user
--------------------------------

The SWPUSRPRF command  does not allow CHGSGNDAT  to be used as  the CMD
parameter as  SWPUSRPRF can  only be run  in a CL  program.  It  can be
made to work by having 2 CL programs.

The  first program runs SWPUSRPRF and  must be run by  a user with *USE
authority to  the  user  profile  to  be changed.    This  is  normally
accomplished by  having the owner  of the program  an *ALLOBJ  user and
creating the program with USRPRF(*OWNER).

             SWPUSRPRF   USRPRF(xxx) CMD(CALL SUBPGM)

SUBPGM would specify:

             CHGSGNDAT

When  SUBPGM is called,  the user profile  has been swapped  to the new
user profile, which then changes the current profile.

The first program could be authorized to specific individuals.

The second program  could ensure  that it  was called by  the first  by
doing:

              DCL        &CALLINGPGM *CHAR LEN(10)
              DCL        &CALLINGLIB *CHAR LEN(10)
               .
              RTVPGMNAM  CALLINGPGM(&CALLINGPGM) +
                           CALLINGLIB(&CALLINGLIB)
              IF         ((&CALLINGPGM *NE 'xxxx') *OR +
                           (&CALLINGLIB *NE 'yyyy')) DO
              SNDESCMSG  MSG('You cannot call this program')
              ENDDO

CHGSGNDAT escape messages you can monitor for
---------------------------------------------

      TAA9891    Signon date/time not changed

TAA9891 occurs if  ALWNOSWP(*NO) is specified  and the signon  user and
current user are the same.

Escape messages from based on functions will be re-sent.

CHGSGNDAT Command parameters                          *CMD
----------------------------

   ALWNOSWP      A  *YES/*NO   parameter  for  whether   to  allow  the
                 CHGSGNDAT  command  if  a user  profile  swap  has not
                 occurred.

                 *NO is  the default to  prevent the  change and  cause
                 the TAA9891 escape message.

                 *YES may be specified to allow the change.


Restrictions
------------

CHGSGNDAT must be run in a CL program.

Prerequisites
-------------

The following TAA Tools must be on your system:

     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   CHGSGNDAT     *CMD                   TAASEFH       QATTCMD
   TAASEFHC      *PGM       CLP         TAASEFHC      QATTCL
					

Added to TAA Productivity tools January 1, 2008


Home Page Up to Top