IBM Support

PI74261: LUA PROC USING PCALL(OPTIM.MASK()) STORES WRONG MSG ON DISCARD

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • In a Lua procedure, if pcall is used to encapsulate an
    optim.mask() call, and ODPP returns an error indicating that the
    row is being discarded, the wrong reason is posted to the Optim
    control file.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Optim/z users working with Column Map Lua procedures (CM     *
    * PROC), especially optim.mask() Optim Data Privacy API        *
    * functions.                                                   *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * This APAR addresses the following issues:                    *
    *                                                              *
    * 1. When a CM PROC invokes the optim.mask() function for      *
    * example to use the LOOKUP provider, and does not use the     *
    * WHENNOTFOUND=PRESERVE keyword to control the function, an    *
    * error is being raised by optim.mask, the destination values  *
    * have undefined values and the row is being discarded. This   *
    * is expected and documented behavior. The user has no ability *
    * to control the outcome in such scenario.                     *
    *                                                              *
    * 2. Even in scenarios when optim.mask() is being invoked      *
    * using the Lua "protective call" pcall() function, and the    *
    * user is able to determine that the function returned an      *
    * error e.g., LOOKUP and set the destination values by         *
    * themselves, Optim is marking the row as having a "conversion *
    * error" and dropping it from processing. In addition, an      *
    * incorrect conversion error code is being stored in the       *
    * control file for such a scenario.                            *
    *                                                              *
    * 3. When selecting a CM PROCEDURE for BROWSE using the ISPF   *
    * 6.A option and exiting without any changes, the message "CM  *
    * xxxxxxx has been saved" may be issued even though no changes *
    * has been made to the CM PROC. This will occur when the TSO   *
    * USERID of the person performing the BROWSE is different than *
    * the last USERID who updated the CM PROC.                     *
    *                                                              *
    * 4. When working with CM PROCEDURES using the selection panel *
    * one may receive the error message FOPK120I "PROC NOT FOUND"  *
    * and the CM PROC status would be set to *DELETED when         *
    * actually the CM PROC is being used by another user.          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Apply this fix.                                              *
    ****************************************************************
    The following problems and issues have been determined:
    These numbers match the errors described under Problem
    Description.
    
    1.The behavior is expected and WAD. An enhancement will be
    provided.
    
    2. The behavior is expected and WAD. An enhancement will be
    provided. The correct conversion error code will be stored in
    the CONTROL file when pcall() is used and row is discarded.
    
    3. The incorrect behavior will be changed.
    
    4. The incorrect behavior will be changed.
    

Problem conclusion

  • The following enhancement and fixes will be provided:
    
    1. When a CM PROC invokes the optim.mask() function using the
    LOOKUP provider, and does not use the WHENNOTFOUND=PRESERVE
    keyword to control the function, or any Data Privacy Provider
    where a row error is returned and does not use the Lua
    "protective call" pcall() function, an error is being raised by
    optim.mask, the destination values have undefined values and the
    row is being discarded. This is expected and documented
    behavior. The user has no ability to control the outcome in such
    scenario.  However an enhancement is being provided for
    scenarios where the user changes their CM PROC Lua chunks to
    utilize the Lua "protected call" pcall() function, see #2.
    
    2. The following enhancement will allow for the user to detect
    and handle the scenarios when WHENNOTFOUND=ERROR (which is the
    default), has been specified for optim.mask LOOKUP provider and
    the LOOKUP value(s) have not been found in the LOOKUP table, or
    any returned row error from other Providers as well:
    
    o The user needs to change their CM PROC Lua chunks to utilize
    the Lua "protected call" pcall() function surrounding the
    optim.mask() invocation, for example:
    
    rcstatus, out_firstn, out_lastn =
    pcall(optim.mask,myempno,myempnum,myfname,mylname,mask_to_use)
    
    o The user should evaluate the rcstatus value:
    	When TRUE, then optim.mask LOOKUP processing was successful and
    the destination variables have values assigned.
    	When FALSE, then optim.mask LOOKUP processing has encountered
    an error and the destination values have no meaningful values
    assigned. An "error" table will be placed on the Lua stack with
    detailed information about the error. The following values will
    be provided:
    	o error.code: the general error code of PST_CM_EXIT_REJECT_ROW
    (1). This will force the row to be discarded when optim.mask()
    has not been protected by pcall().
    
    	o error.reason: the actual code passed from the provider. Could
    be 6030 for "Lookup data not found", as an example.
    
    	o error.message: the error message pulled by optim.mask for the
    error returned from provider. For example: "IOQDP0439E: Lookup
    data not found".
    
    o The user should decide how to proceed. He may chose to assign
    values to the destination column(s) using some defaults or the
    source values. Once a value has been assigned to the destination
    column, on which the CM PROC has been defined, Optim will assume
    that the user detected the Privacy Provider error (LOOKUP as
    example) and handled it to his satisfaction. The row will be
    processed successfully and not dropped.
    
    o If the user does not assign a value to the destination column
    Optim will assume that the row should be dropped because of the
    LOOKUP (or other Provider) error.
    
    Sample CM PROC utilizing these new capabilities is being added
    as samplib member FOPLUAE.
    
    3. The behavior has been corrected.
    
    4. The behavior has been corrected.
    
    Sample output for row which raised the WHENNOTFOUND error:
    
    GREGCZ.LUASMLOOKD:  ***** processing row 2
    
    GREGCZ.LUASMLOOKD:  empno value is 000020
    
    GREGCZ.LUASMLOOKD:  empnonum value is 20
    
    GREGCZ.LUASMLOOKD:  FIRSTNCHR value is MICHAEL
    
    GREGCZ.LUASMLOOKD:  LASTNCHR value is ALONZO
    
    GREGCZ.LUASMLOOKD:  -------------------------------------
    
    GREGCZ.LUASMLOOKD: **return from optim.mask**
    
    GREGCZ.LUASMLOOKD: rcstatus   : false type is boolean
    
    GREGCZ.LUASMLOOKD: out_firstn : table: 25B72B68 type is table
    
    GREGCZ.LUASMLOOKD: out_lastn  : nil type is nil
    
    GREGCZ.LUASMLOOKD: The error code/reason is 1/6030
    
    GREGCZ.LUASMLOOKD: Function optim.mask() for column LASTNCHR
    returned the following error message: IOQDP0439E: Lookup data
    not found
    GREGCZ.LUASMLOOKD: **** optim.mask failed ****. See return
    values above.
    
    GREGCZ.LUASMLOOKD: If the destination column is not set now, the
    row will be discarded.
    
    GREGCZ.LUASMLOOKD: This sample chunk DOES set the destination
    column from SOURCE!
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI74261

  • Reported component name

    OPTIM MOVE FOR

  • Reported component ID

    5655V0700

  • Reported release

    B30

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-12-29

  • Closed date

    2017-01-23

  • Last modified date

    2017-02-01

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Modules/Macros

  • fopclua  fopclua2 fopzxfm3 fopmplst fopcxin2 fopluae  FOPMAIN
    FOPMMCMR FOP9APIM FOPMECMN FOPRS10  FOPCFPMN FOPOMN   FOPCXLIB
    FOPMADDE FOPHSTM  FOPZMAIN FOPMUXIM FOPLUAE  FOPMMJBS FOPMMUNU
    FOPMCOLP FOPMEMAI FOPMCMAI FOPZFMMN
    

Fix information

  • Fixed component name

    OPTIM MOVE FOR

  • Fixed component ID

    5655V0700

Applicable component levels

  • RB30 PSY UI44132

       UP17/01/25 P F701

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"B30","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
01 February 2017