Like system symbols, user symbols can represent any type of variable information in a program. When planning to define user symbols, you should first determine if the system symbols provided by the system, and their associated substitution texts, meet your needs. Define user symbols only if you need additional values.
Suppose you are writing a program that is to access several data sets each time it runs. The user is to provide the name of the specific data set to be used.
Your first step is to create a pattern, or "skeleton", for the data set name. You decide to use the name of the system on which the program runs as a high-level qualifier, and the name of the data set that the user provides as a low-level qualifier.
TESTDATA DC C'&&DATAID.' Define the symbol &DATAID
&SYSNAME..&DATAID..DS1
&SYSNAME..&DATAID..DS2
&SYSNAME..&DATAID..DS3
EXEC PGM=MYPGM,PARM='DATA1'
DATAIDSUBTEXT DC C'DATA1' Substitution text for &DATAID
SYS1.&SYSNAME..&DATAID..DS1
SYS1.&SYSNAME..&DATAID..DS2
SYS1.&SYSNAME..&DATAID..DS3
SYS1.DATA1.DS1
SYS1.DATA1.DS2
SYS1.DATA1.DS3
Calling the ASASYMBM service explains how to call ASASYMBM to perform the substitution described in the example.