About Scope
You can assign variables within the job block or within any other block, and they are local to that block. For example, if you assign a variable in the job block but outside and before any other block, you can use it in the prejob, postjob, pretask, or posttask blocks. Inside a block, a variable can be assigned as global variable, which is visible within other related blocks, with the following syntax:
global a = 5.2