Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I update an OPC variable table from REXX

Status
Not open for further replies.

Jimanderin

Programmer
Feb 7, 2002
13
0
0
GB
Hi

I realise that this is an obscure one, but does anyone know how (or if) I can update an OPC variable table through a REXX program or similar. All I have used to access these tables in the past is %OPC SCAN in the JCL of the job. This reads the variable table associated with the job (in OPC) into the job itself, but can anyone tell me how I can write/update it?

Thanks
Jim
 
How does it "read the variable table"? Are you able to see code which (e.g.) TBOPENs a table called ---PROF? If that data is held in a profile-table, you're in...

Data in a profile-table are kept as extension variables, so you can retrieve them by
Code:
"TBSKIP" profname "SAVENAME(SAVES)"

"SAVES" appears as "(var1 var2 var3 ... varn)". Peel the bananas and you have your list of variable names, all of which represent REXX variables which were populated by the TBSKIP. Now you can reassign those of interest.

With the data changed as needed,
Code:
"TBMOD" profname "SAVE(SAVES)"


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks for the quick response.

I am trying to access a JCL variable table through REXX. This table is not a DB2 table, but one which is set up in the OPC/A batch scheduler. So unfortunately I can't use the code you suggested Frank.

What I need is a way to read and update this variable table data from within a program or job. I thought that REXX may be able to do this as it is the most flexible language for data manipulation I have at my disposal, but I haven't been able to find any way of doing it just yet.

I'll keep searching, but may have to tell my users that this is not possible.

Regards
Jim
 
Do you know how OPC stores the table data? I know that a FETCH is like an INCLUDE, and if it is a member of a dataset you should be able to read and re-write it with EXECIO.

If it is stored internally in OPC you could be stuffed unless you have access to OPC source code.
 
OPC stores the variable table data within VSAM files but the field names do not match with those seen through OPC. On top of that, the ops people don't want people updating the variable tables via VSAM, quite rightly, for fear of corrupting them.

So, I am stuffed as you say, and will need to find another approach. I reckon dynamic JCL may hold the key.

Many thanks to those who read/replied to my posted dilemma.

Jim
 
Check into exit DRKSUBUS.

I used to feed variables into OPCA jobs with that. It is a long time since I worked with OPCA but I suspect this exit is still available.

The trouble will be that it probably can't be written in REXX.

Good luck
 
You'd need to ADDRESS EQQYCOM and depending on whether you wish to modify the Current Plan, LTP or Application Database either use MODIFY CPOC JCLVTAB, MODIFY LTOC JCLVTAB or REPLACE JCLV. Refer to the OPC / TWS PIF manual for record layouts, it's a lot of code to do not very much though.
 
An alternative to using REXX is to use the PL1 PIF programs in the OPC / TWS Sample library in member EQQPIFJV. The comments state:
"Using card images read in using the CARDIN dataset the user will be able to DELETE, COPY, CREATE and MODIFY JCL variable tables"
This may be a better option.




 
What is it that you want the user to be able to change? Personally I wouldn't allow them to change a thing in a production environment...otherwise you compromise your production schedules. If it needs 'user tweaking' to run then the chances are good that it isn't set up correctly.

That having been said I do have a sample DRKSUBUS exit for sysmbolic substitution of dates in a JCL stream. It is written in assmebler though. If you would like it just let me know where to send it and I will pass it along.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top