z/OS ISPF Dialog Developer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Naming defined and implicit variables

z/OS ISPF Dialog Developer's Guide and Reference
SC19-3619-00

A defined variable and an implicit variable can have the same name. This occurs when, using the VDEFINE service, a defined variable is created that uses the same name as an existing implicit variable. When the same name exists in both the defined and the implicit areas of a function pool, only the defined entry can be accessed. You can make the implicit entry accessible by using the VDELETE service to remove any defined entries for that variable name made through the VDEFINE service. The implicit entries are not affected.

You can define a given dialog variable name many times within a given function. Each definition can associate a different program variable with the dialog variable name. This is referred to as stacking. Only the most recent definition of that dialog variable is accessible. A previous definition of that variable can be made accessible by using the VDELETE service to delete the more recent definitions of that name.

For example, the main routine of a program can define a dialog variable to be associated with one program variable. A subroutine is called and can define the same dialog variable name to be associated with a different program variable. Any ISPF services invoked after the second VDEFINE would have access to only the subroutine's program variable. The subroutine would use the VDELETE service to delete that dialog variable before returning, thereby uncovering the earlier definition set up in the main routine. To avoid a possible program error, each VDEFINE processed within a function for a given dialog variable name should have a VDELETE using the same name or an asterisk (*) as the operand. When an asterisk is used as the operand, the VDELETE service removes all dialog variable names previously defined by the program module from the function pool.

The VRESET service allows a program to remove its function pool variables as though VDELETEs had been done. Any implicit variables are also deleted.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014