Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to substring a new dataset name from a old one?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
javen777

New User


Joined: 06 Mar 2015
Posts: 28
Location: china

PostPosted: Tue Feb 19, 2019 12:00 pm    Post subject: How to substring a new dataset name from a old one?
Reply with quote

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
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2180
Location: Hampshire, UK

PostPosted: Tue Feb 19, 2019 3:11 pm    Post subject: Reply to: How to substring a new dataset name from a old one?
Reply with quote

Do the simpler and more easily maintainable thing and treat each function as a separate job - not three rolled into 1.
Back to top
View user's profile Send private message
javen777

New User


Joined: 06 Mar 2015
Posts: 28
Location: china

PostPosted: Wed Feb 20, 2019 7:22 am    Post subject: Re: Reply to: How to substring a new dataset name from a old one?
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 193
Location: UK

PostPosted: Wed Feb 20, 2019 4:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
javen777

New User


Joined: 06 Mar 2015
Posts: 28
Location: china

PostPosted: Thu Feb 21, 2019 8:52 am    Post subject:
Reply with quote

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
View user's profile Send private message
javen777

New User


Joined: 06 Mar 2015
Posts: 28
Location: china

PostPosted: Thu Feb 21, 2019 8:54 am    Post subject:
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 193
Location: UK

PostPosted: Fri Feb 22, 2019 9:57 pm    Post subject:
Reply with quote

I'm sorry, but I don't understand either of your replies. Is there another question in there somewhere?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Placement of an LPALIB dataset for IPL Alan Playford JCL & VSAM 3 Sun May 12, 2019 5:50 pm
No new posts Need to strip off first line - ascii ... harisukumaran DFSORT/ICETOOL 7 Thu May 02, 2019 12:35 am
No new posts Unpack 'PACK ON' dataset via job? Auryn TSO/ISPF 2 Thu Mar 14, 2019 4:09 pm
No new posts how to copy a sequential dataset by u... javen777 JCL & VSAM 3 Thu Feb 21, 2019 11:37 pm
No new posts How to delete a VSAM dataset from ins... Mike.Fulton JCL & VSAM 6 Fri Feb 15, 2019 5:58 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us