Page 1 of 1

OPC SCAn

PostPosted: Thu Feb 28, 2008 4:17 pm
by anoopm7
Can some one explain me whts an OPC scan used in JCl.


Thanks in advance.

Re: OPC SCAn

PostPosted: Thu Feb 28, 2008 6:45 pm
by arunprasad.k
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.

Re: OPC SCAn

PostPosted: Fri Feb 29, 2008 11:13 am
by anoopm7
Arun,Thanks for the quick response.

Iam not able to digest all wht u said.Could u plz explzin me why we are using OPC variable(i mean under what special condition).



Thank's in aDvance 8-)

Re: OPC SCAn

PostPosted: Fri Feb 29, 2008 2:09 pm
by arunprasad.k
How do you do the following task?

#1 Create a file with daily with the current date as a qualifier?
#2 Your program needs the last calender day or work day of the previous month for some processing? (I hope you know the difference between last work day and calender day).
#3 My last example in the previous post (regarding different parm for different months run)?

I can add so many things but would like to limit with some basic example.

You can do some of the above stuffs with simple coding and some other needs complex coding. But OPC helps the programmers to do the above tasks by simply by substuting the values to the corresponding symbolic variables.

Eventhough Operation Planning and Control is a scheduler, these are value adds (I believe :lol: )

If you still have some questions. Please post which point you do not understand.

Arun.

Re: OPC SCAn

PostPosted: Mon Mar 03, 2008 1:42 pm
by anoopm7
Arun,
Your examples were helping..i understand the concept of OPC now.

Thankyou. :D

Re: OPC SCAn

PostPosted: Mon Mar 03, 2008 2:42 pm
by arunprasad.k
Good!! Have a nice learning. :P