View previous topic :: View next topic
|
Author |
Message |
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
Dear all,
background:
I am now writing a data set triggered OPC appl which only contains 1 UNLOAD JCL.
This OPC's data set trigger varies, for example:
TFMS.F.DD.FMSNT99C.NLGRAIW.REV1.TRIGGER
TFMS.F.DD.FMSNT99C.NLGRAIW.W301.TRIGGER
TFMS.F.DD.FMSNT99C.NLGRAIW.GS02.TRIGGER
........
In the unload JCL head, it has:
//*%OPC SCAN
// SET TRIGNAM=%OETEVNM
//*%OPC BEGIN ACTION=NOSCAN
which means if the OPC is trigger by any of above data sets, the trigger data set name will be fetched from OPC system and gives the value to the variable TRIGNAM.
for example, it will change to below if run in OPC:
//*%OPC SCAN
// SET TRIGNAM=TFMS.F.DD.FMSNT99C.NLGRAIW.REV1.TRIGGER
//*%OPC BEGIN ACTION=NOSCAN
.............................
//*%OPC SCAN
// SET TRIGNAM=TFMS.F.DD.FMSNT99C.NLGRAIW.W301.TRIGGER
//*%OPC BEGIN ACTION=NOSCAN
My question:
In the followed step there is 1 unload step and the unloaded data set name should be the trigger name without the last qualifier 'TRIGGER', for example:
TFMS.F.DD.FMSNT99C.NLGRAIW.REV1
TFMS.F.DD.FMSNT99C.NLGRAIW.W301
TFMS.F.DD.FMSNT99C.NLGRAIW.GS02
.......
how can i only fetch the qualifiers from trigger data set name only without last qualifier 'TRIGGER'? not hard-coded way, because REV1 trigger only generates REV1 data set, W301 trigger only generates W301 data set.
The unloaded data set name varies according to trigger name.
thank you! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Do the simpler and more easily maintainable thing and treat each function as a separate job - not three rolled into 1. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
Nic Clouston wrote: |
Do the simpler and more easily maintainable thing and treat each function as a separate job - not three rolled into 1. |
Thanks for the reply Nic, better to achieve this function for easy maintainance in the future |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Two ways that spring to mind, depending on whether you want the bulk of the code within your JCL or set up within the TWS dialogs.
For option 1, you'd need three sets of //*%OPC BEGIN ACTION=INCLUDE statements along with a COMP keyword to test the value of the OETEVNM variable in each case. For whichever of the three was true, subsequent lines of JCL would then be included to SET the value of TRIGNAM to the desired dataset name.
For option 2, set up a JCL variable table (option 1.9 from the primary TWS menu). Define the "dependent" variable as TRIGNAM and the "independent" variable as OETEVNM. Then you can say if the value of OETEVNM is TFMS.F.DD.FMSNT99C.NLGRAIW.REV1.TRIGGER then the value of TRIGNAM will be TFMS.F.DD.FMSNT99C.NLGRAIW.REV1, etc.
The other question of course is why not do the triggering on the base dataset in the first place? What is the purpose of the TRIGGER dataset? The application is not triggerred until the dataset is closed, so there are no concerns about only processing an incomplete dataset, etc. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
Two ways that spring to mind, depending on whether you want the bulk of the code within your JCL or set up within the TWS dialogs.
For option 1, you'd need three sets of //*%OPC BEGIN ACTION=INCLUDE statements along with a COMP keyword to test the value of the OETEVNM variable in each case. For whichever of the three was true, subsequent lines of JCL would then be included to SET the value of TRIGNAM to the desired dataset name.
For option 2, set up a JCL variable table (option 1.9 from the primary TWS menu). Define the "dependent" variable as TRIGNAM and the "independent" variable as OETEVNM. Then you can say if the value of OETEVNM is TFMS.F.DD.FMSNT99C.NLGRAIW.REV1.TRIGGER then the value of TRIGNAM will be TFMS.F.DD.FMSNT99C.NLGRAIW.REV1, etc.
The other question of course is why not do the triggering on the base dataset in the first place? What is the purpose of the TRIGGER dataset? The application is not triggerred until the dataset is closed, so there are no concerns about only processing an incomplete dataset, etc. |
thanks for the reply David.
the reason why not do the triggering on the base dataset int the first place , is it's used for the next job to process, so cannot use it as trigger, also it's the purpose of the TIRGGER dataset.
so any idea? |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
Two ways that spring to mind, depending on whether you want the bulk of the code within your JCL or set up within the TWS dialogs.
For option 1, you'd need three sets of //*%OPC BEGIN ACTION=INCLUDE statements along with a COMP keyword to test the value of the OETEVNM variable in each case. For whichever of the three was true, subsequent lines of JCL would then be included to SET the value of TRIGNAM to the desired dataset name.
For option 2, set up a JCL variable table (option 1.9 from the primary TWS menu). Define the "dependent" variable as TRIGNAM and the "independent" variable as OETEVNM. Then you can say if the value of OETEVNM is TFMS.F.DD.FMSNT99C.NLGRAIW.REV1.TRIGGER then the value of TRIGNAM will be TFMS.F.DD.FMSNT99C.NLGRAIW.REV1, etc.
The other question of course is why not do the triggering on the base dataset in the first place? What is the purpose of the TRIGGER dataset? The application is not triggerred until the dataset is closed, so there are no concerns about only processing an incomplete dataset, etc. |
for option 1 and 2 i got your point, and it's already solved by setting all 3 files as trigger and i only need a part of the trigger name, for short. |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I'm sorry, but I don't understand either of your replies. Is there another question in there somewhere? |
|
Back to top |
|
|
|