Mainframe Utility: RESETPFK

Return to Mainframe Utilities Page

Module


/******************************************************************/
/* 'RESETPFK' CLIST       SET A SPECIFIED PF KEY BACK TO ITS      */
/*                        ORIGINAL VALUE                          */
/* AUTHOR : DAVID MONTGOMERY DATE : 12-21-89                      */
/******************************************************************/
PROC 1 PFKEY
  SET XPF = &STR(@@@)
  IF &PFKEY = &STR(HELP) OR &PFKEY = &STR(?) THEN GOTO HELP
  SET PN  =
  SET L   = &LENGTH(&STR(&PFKEY))
  IF &SYSINDEX(PF,&STR(&PFKEY)) = 1 THEN -
     DO
       IF &L > 2 AND &L <= 4 THEN -
          SET PN = &SUBSTR(3:&L,&STR(&PFKEY))
     END
  ELSE -
     IF &L = 1 OR &L = 2 THEN -
        SET PN = &STR(&PFKEY)

  IF &DATATYPE(&PN) = NUM THEN -
     IF &PN < 25 THEN -
        DO
          IF &PN < 10 THEN SET PN = &STR(0)&PN
          ISPEXEC VGET (OPF&PN) PROFILE
          SET COMMAND = &&OPF&PN
          SET ZPF&PN = &STR(&COMMAND)
          SET XPF = PF&PN
          ISPEXEC VPUT (ZPF&PN) PROFILE
        END
     ELSE -
        SET PN =
  ELSE -
     SET PN =

  IF &PN =   THEN -
     SET ERRMSG = -
         &STR(RESETPFK : INVALID PF KEY SPECIFICATION -> &PFKEY)
  GOTO EXIT
/*
HELP: -
  CLEAR
  WRITE *** HELP FOR CLIST RESETPFK ***
  WRITE
  WRITE THE "RESETPFK" CLIST IS USED IN CONJUNCTION WITH THE "SETPFK"
  WRITE CLIST.  WHEN THE "SETPFK" CLIST HAS ASSIGNED A NEW VALUE TO A
  WRITE PF KEY, THE ORIGINAL VALUE IS SAVED IN THE USER'S PROFILE.  THE
  WRITE "RESETPFK" CLIST WILL RESTORE THIS SAVED VALUE TO THE SPECIFIED
  WRITE PF KEY.  IF "SETPFK" HAS NEVER BEEN USED FOR A SPECIFIC PF KEY
  WRITE AND "RESETPFK" IS PERFORMED ON THAT PF KEY, THEN ITS VALUE WILL
  WRITE BE SET TO NULL.  ONLY ONE LEVEL OF PF KEY VALUES IS MAINTAINED.
  WRITE IN OTHER WORDS, "RESETPFK" WILL RESTORE THE COMMAND SAVED FROM
  WRITE THE LAST USE OF THE "SETPFK" COMMAND.
  WRITE
  WRITE COMMAND FORMAT:  RESETPFK 
  WRITE
  WRITE          - THE NUMERIC VALUE OF THE DESIRED FUNCTION
  WRITE                      KEY TO BE RESTORED (USUALLY 1 - 24)
  WRITE
  SET &ERRMSG = &STR(NO RESETPFK PROCESSING PERFORMED)
/*
EXIT: -
  IF &XPF = &STR(@@@) THEN -
      SET ZEDLMSG = &STR(&ERRMSG)
  ELSE -
      SET ZEDLMSG = &STR(RESETPFK : &XPF RESTORED TO "&COMMAND")
  ISPEXEC SETMSG MSG(ISRZ000)
/*
EXIT
            


Documentation


 The RESETPFK Clist is used in comjunction with the SETPFK Clist.  When the
 SETPFK Clist has assigned a new value to a PF Key, the original value is saved
 in the user's Profile.  The RESETPFK Clist will restore this saved value to the
 specified PF Key.  If SETPFK has never been used for a specified PF Key and
 RESETPFK is performed on that PF Key, then its value will be set to null.  Only
 one level of PF Key values is maintained.  In other words, RESETPFK will
 restore the command saved from the last use of the SETPFK command.

 Example: RESETPFK 12
            


Leave a Reply

Your email address will not be published. Required fields are marked *