VMASK—mask and edit processing

The VMASK service associates an edit mask with a dialog variable defined with VDEFINE. The edit mask is a pattern used to validate input into that variable. The mask characters are stripped from the data before it is put into the function pool, or before the data is stored in a table from a TBDISPL. When the masked variable is displayed on a panel, stored in the shared or profile pool, or accessed by VCOPY, the output string contains the mask characters. When specifying the length to receive these variables on the VCOPY call, the length should be as long as the mask, not the defined variable. The length of the mask should also be considered when defining the field in which a masked variable is displayed.

The mask is only associated with the definition of the variable that was active when the VMASK was issued and cannot be used with implicit variables.

For example:
      VDEFINE VAR1         123        A
      VMASK   VAR1        (999)       A
      VDEFINE VAR1         123        B
      VCOPY   VAR1         123        B
      VDELETE VAR1                    B
      VCOPY   VAR1        (123)       A
 

The mask is associated with the A definition of VAR1, not the B definition.

When using a masked variable on a panel, you must issue a VEDIT in the processing section of the panel for that masked variable for the data to be accessible in the function pool. You must issue the VEDIT statement before any other panel statements that reference variables, (such as VPUT or VER). If you don't, the values in the pool will be unpredictable. The VEDIT statement indicates to ISPF that the data entered into the masked variable field should be verified and the mask stripped out. If you don't issue the VEDIT for each masked variable on the panel, the resulting data in the pool will be unpredictable.

The VMASK service is supported for programming languages. The variable must be VDEFINEd with FIXED, PACK, or CHAR formats.