I used OPC a few years back. I will try answering your query based on the little knowledge I have.
OPC Scan will scan for OPC variables in the OPC tables and and substutite the corresponding values from the OPC table.
Consider the following OPC coding,
//*%OPC SCAN
//*%OPC SEARCH NAME=(CURDAY07%OYMD1,CURDAY10%OYMD1,COMMON)
//*%OPC SETVAR TGL0990=(OYYYY - 1YR)
// SET PRYR=%TGL0990
This will search the value for OYYYY in the tables mentioned in line 2 and set the value of TGL0990 with OYYYY - 1YR.
In the table defined in line 2, our should had the current year (eg. 2008) for the variable OYYYY, so TGL0990 will have 2007, so the symbolic variable PRYR will have 2007 when it runs.
Similarly you can also use OPC coding for setting values to some symbolic variables based on some conditional parameter.
Consider the following code.
//*%OPC BEGIN ACTION=INCLUDE,
//*%OPC COMP=(&OMM..EQ.10)
// PARM070=A
//*%OPC END ACTION=INCLUDE
//*%OPC BEGIN ACTION=INCLUDE,
//*%OPC COMP=(&OMM..EQ.11)
// PARM070=C
//*%OPC END ACTION=INCLUDE
When you run this job during the month of October PARM070 will have a value of 'A' and when you run the same job during the month of November it will have 'C'.
Hope you understood, what I am trying to say. Post if you have any questions or concerns.
Arun.