I have become more and more fond of the possibilities for declaring variables in JCL. IBM uses the term JCL symbols or symbolic parameters for JCL variables. You define a JCL variable using the SET DD card and uses it by putting an ampersand (&) in front of its name. In places where you use the JCL variable you may terminate the name using a dot (.) and you have to use a dot as terminator if you need a dot following the variable value. Here is an example:
I use JCL variables in frequently used jobs where the same text occurs several times and needs to be replaced for each new execution. For instance the use of JCL variables is quite handy for dataset names containing dates or the like. You just define a JCL variable containing the date in top of the job and then all you need is to change the variable value to process a new version of the dataset.
When you have realised the power of JCL variables you will soon be annoyed by the fact that:
Apart from the above JCL variables can be used in many useful ways and make your jobs far more flexible to use.