A lot of installations use OPC to execute their production jobs. When OPC submits a job on your behalf you get access to a lot of extra functionality in your JCL which you do not have in JCL you submit using TSO SUBMIT or ISPF EDIT SUBMIT. The advantage is that you can do a lot more stuff with your JCL, but the downside is that you have to use OPC to submit your job in order to test that your JCL works as planned. Unfortunately most installations using OPC does not allow developers to use OPC for job submission. Do not let this detail prevent you from using OPC variables as they make your job capable of doing lots of interesting stuff.
One of the annoying things in ordinary JCL submitted from TSO is that JCL variables cannot be used in inline SYSIN data. OPC has fixed that by introducing OPC variables. OPC variables are typically prefixed by a % character in order to distinct them from JCL variables which are prefixed by an & character. Unfortunately OPC is designed to recognize both % and & as prefixes for OPC variables.
Fortunately OPC by default is set up to replace OPC-variables with their actual values (substitution) only after the first JCL comment looking like this:
If you want to avoid JCL variables to be substituted by OPC after the above JCL comment you should use the following JCL comment:
And you enable substitution again by using:
If you use a NOSCAN comment you must include a SCAN comment later in your JCL. Otherwise OPC will not submit your job.
Now you are ready to use OPC variables. The best thing about OPC variables is that you can use them everywhere in your JCL including inline data. There are two categories of OPC variables namely userdefined and predefined. Userdefined OPC variables are typically defined by the persons responsible for OPC and varies from installation to installation. Predefined OPC variables are always available and are defined by OPC. Let me show you an example:
If you include the above comment in your JCL (and respect the rules of SCAN/NOSCAN) your job output after execution of the job will contain a comment like this:
where MYOPCJOB is the actual job name and MYOPCAPPLICATION is the actual name of the OPC application.
I will end this tip by mentioning that OPC is one of the products that have been enjoying the pleasures of modern marketing. It started out with the name OPC (and most of us old mainframe geeks uses this name). Then it was renamed to TME 10 OPC and now it is called Workload Scheduler with different surnames all containing IBM or Tivoli or both in many variations. All this renaming makes it hard to find a reasonable OPC manual on the internet, but I have tracked down an OPC users guide and reference. This manual is very extensive and fairly easy to use.