IBM Support

Possible Menu Locking Problem after Upgrade

Technote (troubleshooting)


At R530 a change was made that required a conversion to run a first touch of a menu message file. However, if there are two users touching the menu at the same time, conversion of the *MSGF does not occur.

Resolving the problem

On R530, at the first touch of a menu message file, a conversion should run. However, if there are two users touching the menu at the same time, conversion of the *MSGF does not occur.

Note: This issue can occur if a user upgrades from R520 to R540 or beyond.

For more information on this issue, refer to Informational APAR II13978 .

The following is a user-created command that can to used correct this issue.

Caution: These instructions are provided as is. Any assistance this program must be done by a consulting agreement.

Note: There is a save file with this source in it at the bottom of this document.

Command Source:

      TYPE(Q1) MIN(1) MAX(1) FILE(*NO) +
               PROMPT('File name(s) to process')
      TYPE(*LGL) MIN(0) MAX(1) FILE(*NO) +
               PROMPT('Log change completion messages') +
               SPCVAL((*YES '1') (*NO '0')) DFT(*YES)
Q1:      QUAL  TYPE(*GENERIC) LEN(10) MIN(1) RSTD(*NO)  +
               SPCVAL(*ALL) +
               VARY(*NO) EXPR(*YES) PASSATR(*NO)
         QUAL  TYPE(*SNAME) LEN(10) MIN(1) RSTD(*NO) +
               PROMPT('Libraries to search') +
               VARY(*NO) EXPR(*YES) PASSATR(*NO)

CPP Source:

pgm parm(&qn &ci)
/* This program accepts a standard qualified name with generics and */
/* special values like those on OBJ() for DSPOBJD.  Using that OBJ, */
/* the program will attempt RTVMSG against each *MSGF found in that */
/* naming, for which alignment conversion has not yet transpired.   */
/* RTVMSG implicitly attempts to perform space alignment conversion */
/* of the specified message file object.  Each message file that is */
/* not converted by the RTVMSG request will be diagnosed by a       */
/* msgCPF9897.  Each message file converted will be diagnosed by a  */
/* msgCPC2103.  For every *MSGF that can not be converted, the      */
/* probable cause is that there is a conflicting lock, and that     */
/* WRKOBJLCK should be performed to determine the holder of the     */
/* lock, to free that lock <e.g. by ENDJOB>, and then a new attempt */
/* using this program against that message file should resolve.     */
/* This is a derivative work based on the following original source */
/* */  10-Feb-2003     */
/*- 5722SS1 (C) COPYRIGHT IBM CORP. 2003, 2004   -------------------*/
/*- SEE COPYRIGHT INSTRUCTIONS, G120-2083.       -------------------*/
/* Copyright declarations                                           */
               VALUE('5722-SS1 (C) COPYRIGHT IBM CORP. 2003, 2004')
/* Parameter declarations                                                    */
 dcl &qn *char 20     /* Qualified name; see DSPOBJD parm OBJ(); Gen* & Sval */
 dcl &ci *lgl         /* Completion msg log ind:    '1' log; '0' no log      */
/* Non-Parameter, program control variable declarations                      */
 dcl &ln *char 10     /* Library name; see DSPOBJD parm OBJ() Library values */
 dcl &fn *char 10     /* MsgF name; see DSPOBJD parm OBJ() Object values     */
 dcl &ad *char 10     /* ASPDEV; see DSPOBJD ASPDEV() parm Device values     */
 dcl &ag *char 10     /* ASPGRP; see RTVJOBA ASPGRP() parm values            */
 dcl &st *char 07     /* ASPDEV; see DSPOBJD ASPDEV() parm Search Type values*/
 dcl &dw *dec ( 7 0)  /* DfwWait; see RTVJOBA DFTWAIT() parm                 */
 dcl &cc *dec ( 9 0)  /* change counter; nbr of msgf changed; for &b4 data   */
 dcl &b4 *char 04     /* &1 *bin4                                            */
 dcl &of *char 10     /* OutFile name; constant */ VALUE('QADSPMSGF ')
 dcl &ol *char 10     /* OutFile Library; const */ VALUE('QTEMP     ')
 dcl &ov *lgl         /* Override to be setup   */ VALUE('1')
/* File declarations; L: List of *MSGF to process  C: Conversion status      */
 dclf qadspobj alwvarlen(*no) alwnull(*no) rcdfmt(QLIDOBJD) opnid(L) /* Lst  */
 dclf qadspobj alwvarlen(*no) alwnull(*no) rcdfmt(QLIDOBJD) opnid(C) /* Cvt  */
/* global monitor declares                                                   */
 monmsg cpf4520
 monmsg cpf0000 exec(goto badthing)

 chgvar &ln (%sst(&qn 11 10))
 chgvar &fn (%sst(&qn 01 10))

 rtvjoba aspgrp(&ag) dftwait(&dw)
 if (&ag *ne '*NONE     ') then(do)
  chgvar &ad &ag
  chgvar &st '*ASPGRP'
 else do
  if (%sst(&ln 1 1) *eq '*') then(chgvar &ad '*         ')
  else (chgvar &ad '*ALLAVL   ')
  chgvar &st '*N     '

 chkobj &ol/&of *file
 monmsg cpf9801 exec(do)
  rcvmsg pgmq(*same (*)) msgq(*pgmq) msgtype(*excp) rmv(*yes)
  crtdupobj qadspobj *LIBL *file &ol &of data(*no)
  chgpf &ol/&of size(*nomax) maxmbrs(2)
 dspobjd &ln/&fn   *msgf output(*outfile) outfile(&ol/&of) +
         aspdev(&ad &st) outmbr(PASS_ONE *REPLACE)
 addpfm &ol/&of PASS_TWO
 monmsg cpf7306 exec(do)                /* CPF5812 is diag */
  rcvmsg pgmq(*same (*)) msgq(*pgmq) msgtype(*excp) rmv(*yes)
  rcvmsg pgmq(*same (*)) msgq(*pgmq) msgtype(*diag) rmv(*yes)
 clrpfm &ol/&of PASS_TWO
 monmsg cpf3141 exec(do)
  rcvmsg pgmq(*same (*)) msgq(*pgmq) msgtype(*excp) rmv(*yes)

 rmvmsg pgmq(*same (*)) msgq(*pgmq) clear(*all) rmvexcp(*no)

 ovrdbf qadspobj &ol/&of mbr(PASS_ONE) share(*yes)
nextmsgf: /* loop to process each msgf in the outfile                        */
 rcvf opnid(L)
 monmsg cpf0864 exec(do)
  rcvmsg pgmq(*same (*)) msgq(*pgmq) msgtype(*excp) rmv(*yes)
  goto done

 if &ov then(do)             /* override must be established for opnid(C)    */
  chgvar &ov '0'
  ovrdbf qadspobj &ol/&of mbr(PASS_TWO) share(*yes)
  chgjob dftwait(1)

 if (&L_ODALGN *eq '0') then(do)
cvtmsgf:  /* perform the work required to convert a msgf; i.e. RTVMSG        */
  rtvmsg msgid(PFX0000) msgf(&L_odlbnm/&L_odobnm) /* Retrieve bogus message  */
  monmsg CPF2419 /* Ignore the status message CPF2419 which is expected      */
  dspobjd &L_odlbnm/&L_odobnm &L_odobtp output(*outfile) outfile(&ol/&of) +
          aspdev(&ad &st) outmbr(PASS_TWO *ADD) /* No ODALGN info by RTVOBJD */
  rcvf opnid(C)                          /* Read the record just added       */
  if (&C_ODALGN *eq '1') then(do)        /* The file was just converted      */
   chgvar &cc (&cc + 1)                  /* Increment Count of Changed files */
   if &ci then(do)                       /* If *LOG then send completion msg */
 /*- MSG: CPC2103 &1-&3 each Char(10) - Object changed for &1 in &2 type &3. */
    sndpgmmsg msgdta(&C_odobnm *cat &C_odlbnm *cat &C_odobtp) +
         topgmq(*prv) msgid(cpc2103) msgtype(*comp) msgf(qcpfmsg)
  else do
   /* Infer file could not be converted due to locks, issue CPF2483 as diag, */
   /* and issue some message <e.g. CPDA972 for its 1st lvl text and cause>   */
   /* that explains the file is not converted and is WRKOBJLCK is recovery.  */
 /*- MSG: CPF2483 Message file currently in use.                             */
   sndpgmmsg +
        topgmq(*prv) msgid(cpf2483) msgtype(*diag) msgf(qcpfmsg)
   sndpgmmsg msgdta('WRKOBJLCK' *bcat &C_odlbnm *tcat '/' *tcat &C_odobnm +
    *bcat &C_odobtp ) topgmq(*prv) msgid(cpf9897) msgtype(*diag) msgf(qcpfmsg)

 goto nextmsgf

 chgjob dftwait(&dw)
 /*- MSG: CPC240B &1 *B4        &1 msgf changed.                             */
 chgvar %bin(&b4 1 4) &cc
 sndpgmmsg msgdta(&b4) tomsgq(*topgmq) +
      topgmq(*prv (*)) msgid(cpc240B) msgtype(*comp) msgf(qcpfmsg)


 /*- MSG: CPF9899 Request failed, see previously logged msgs.                */
 sndpgmmsg +
      topgmq(*prv) msgid(cpf9899) msgtype(*escape) msgf(qcpfmsg)


The following is a save file that contains the source file CVTMSG:


Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 7.2
Operating System IBM i 7.1

Historical Number


Document information

More support for: IBM i
Programming (Languages- compilers- tools)

Software version: 7.1.0, 7.2.0

Operating system(s): IBM i

Reference #: N1019136

Modified date: 2012-12-29