View previous topic :: View next topic
|
Author |
Message |
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
Dear all,
my code:
Code: |
//DMDSPKCT JOB (@INF,FF31),'DMDSPKCT',
// USER=SPARKID,MSGCLASS=X,TIME=1440,REGION=0M
// JCLLIB ORDER=(TFMS.F.DD.PROCLIB,TFMS.DD.PROCLIB)
//*
//*
//*
//FMSSYM INCLUDE MEMBER=FMS#SYM * DEFAULT SYMBOLICS
// SET JOBNAME=FMSSPKCT
//*%OPC SCAN
// SET TRIGNAM=%OETEVNM
//*%OPC SETVAR TVAR2=SUBSTR(&TRIGNAM,3,2)
//*%OPC BEGIN ACTION=NOSCAN
//STEP001 EXEC PGM=IEFBR14
//FILE02 DD DSN=ABC,
// SPACE=(TRK,(1,1)),DISP=(MOD,DELETE,DELETE) |
this jcl is in a file trigger opc, as long as i remove line of SETVAR, job run fine. But i need the SETVAR working, so you plz help on this?
thank you! |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
forgot to mention: there is no error log in spool, can only see job 'Ended in error' in OPC |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
First, you are using an OPC (Tivoli Workload Scheduler) construct which has NOTHING to do with JCL -- so do NOT call it "SETVAR in JCL".
Second, did you look at the SETVAR in the TWS manual? The syntax diagram says at publib.boulder.ibm.com/tividd/td/TWS/SC32-1263-00/en_US/HTML/EQQR1MST342.htm
Code: |
>-//*%OPC SETVAR----------------------------------------------->
>--Tname=(-date variable +/- nnnTT-)-+---------------------+---><
| .-SUBMIT-. |
'-,PHASE=--+-SETUP--+-' |
and I don't see anything in the syntax diagram about using SUBSTR. You cannot just make up what you want to do -- you have to follow the rules as described in the syntax diagrams.
And there would not be any error in the spool -- you don't have a JCL error, you have a TWS error. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
Robert Sample wrote: |
First, you are using an OPC (Tivoli Workload Scheduler) construct which has NOTHING to do with JCL -- so do NOT call it "SETVAR in JCL".
Second, did you look at the SETVAR in the TWS manual? The syntax diagram says at publib.boulder.ibm.com/tividd/td/TWS/SC32-1263-00/en_US/HTML/EQQR1MST342.htm
Code: |
>-//*%OPC SETVAR----------------------------------------------->
>--Tname=(-date variable +/- nnnTT-)-+---------------------+---><
| .-SUBMIT-. |
'-,PHASE=--+-SETUP--+-' |
and I don't see anything in the syntax diagram about using SUBSTR. You cannot just make up what you want to do -- you have to follow the rules as described in the syntax diagrams.
And there would not be any error in the spool -- you don't have a JCL error, you have a TWS error. |
thanks for the reply Robert.
actually i am seeing this:
Code: |
>>-//*%OPC SETVAR----------------------------------------------->
>--+-Tname=--(--date time variable +/- nnnTT1 nnnTT2 nnnTT3--)-+-><
+-Tname=--SUBSTR--(--variable--,--n--,--length--)-----------+
+-Tname=--(--numeric value / 'alphanumeric value'--)--------+
+-Tname=--(--variable1 +/- variable2--)---------------------+
| .--------------------. |
| V | |
'-Tname=--(--'----concatenation item-+--'--)----------------'
|
www.ibm.com/support/knowledgecenter/SSRULV_9.5.0/com.ibm.tivoli.itws.doc_9.5/distr/src_sazos/awsszsetvar.htm
this is the correct one? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
VAR1 is a variable defined in a JCL variable table |
Is your resolved variable &TRIGNAM so defined? |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Robert's syntax diagram does indeed seem to be incomplete, the SUBSTR directive is valid according to the v9.3 manual.
Why are you specifying the variable as %OETEVNM rather than &OETEVNM? % variables are used to form compound variables. I would imagine that would be the problem. I'm also curious as to why you're setting TRIGNAM to %OETEVNM and then getting a substring of that. Why not just get a substring of &OETEVNM?
If that doesn't help, then review the error in TWS. For jobs that fail in TWS before submission to JES, TWS will insert appropriate error messages in to the JCL. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
Robert's syntax diagram does indeed seem to be incomplete, the SUBSTR directive is valid according to the v9.3 manual.
Why are you specifying the variable as %OETEVNM rather than &OETEVNM? % variables are used to form compound variables. I would imagine that would be the problem. I'm also curious as to why you're setting TRIGNAM to %OETEVNM and then getting a substring of that. Why not just get a substring of &OETEVNM?
If that doesn't help, then review the error in TWS. For jobs that fail in TWS before submission to JES, TWS will insert appropriate error messages in to the JCL. |
thanks David.
in TWS it only says ERROR IN JCL.
As of OETEVNM , i also tried substring of OETEVNM , but still ERROR IN JCL and no log.
it seems the SETVAR only works only variable contain DATE or TIME parms like MM, DD, or OCDATE etc |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
When you say that in TWS, it only says ERROR IN JCL, where are you looking? In the JCL? I can't imagine that you would see ERROR IN JCL if you browse the JCL. I have tried the same thing and I get this -
Code: |
====== //*>OPC SCAN
====== // SET TRIGNAM=%OETEVNM
=NOTE= //*>EQQJ535E 02/26 09.36.28
=NOTE= //*> UNDEFINED VARIABLE OPC LINE 00011 OF ORIG JCL
====== //*%OPC SETVAR TVAR2=SUBSTR(&TRIGNAM,3,2)
====== //*%OPC BEGIN ACTION=NOSCAN
====== //STEP001 EXEC PGM=IEFBR14 |
You need to be clear about the difference between variables that TWS will resolve prior to submission and those that JES will resolve after submission. The SET statement is a JCL statement. So although TWS will resolve the OETEVNM variable, it will not know that TRIGNAM has that same value, and hence will not be able to get a SUBSTR of it.
So, as per my previous note, what are you trying to achieve by setting a new variable TRIGNAM to the value of OETEVNM? If you just use the OETEVNM variable, you will not have this issue. |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I have successfully obtained a substring of the OETEVNM variable, it definitely does work. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
I have successfully obtained a substring of the OETEVNM variable, it definitely does work. |
OETEVNM will be the value of file trigger name.
do you mean you are able to substr the file trigger name??
could you plz share the code here?
thank you very much! |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
I have successfully obtained a substring of the OETEVNM variable, it definitely does work. |
and also plz share your substr result? |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
What problem are you now getting? And what is the point of sharing my SUBSTR result, it will clearly be different to yours as the trigger name is different. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
What problem are you now getting? And what is the point of sharing my SUBSTR result, it will clearly be different to yours as the trigger name is different. |
the problem i am getting right now is i need to substr the trigger name in my JCL and give it to another newly created file as its file name.
could you plz show me? so i can use it in my JCL.
thank you very much |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
The OPC statements are processed withi OPC before the job is submitted. The SET sttements is a JCL control statement and it is executed by the reader/interpreter after (or as) the job is submitted. Therefore OPC cannot substr the value set by the SET statement. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
Nic Clouston wrote: |
The OPC statements are processed withi OPC before the job is submitted. The SET sttements is a JCL control statement and it is executed by the reader/interpreter after (or as) the job is submitted. Therefore OPC cannot substr the value set by the SET statement. |
thanks Nic!
is there any way i can substr OETEVNM(which is trigger file name) by using SETVAR? or any other way? |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I'm not going to code it all for you. You have not adequately explained why you are trying to set a new TRIGNAM variable to the value of OETEVNM and then get the SUBSTR of that. Both myself and Nic have explained why that will not work.
As I have said previously, I have successfully obtained a SUBSTR of OETEVNM.
If you post what you have coded and explain how it's not working then I'm sure somebody will try and help. |
|
Back to top |
|
|
javen777
New User
Joined: 06 Mar 2015 Posts: 31 Location: china
|
|
|
|
David Robinson wrote: |
I'm not going to code it all for you. You have not adequately explained why you are trying to set a new TRIGNAM variable to the value of OETEVNM and then get the SUBSTR of that. Both myself and Nic have explained why that will not work.
As I have said previously, I have successfully obtained a SUBSTR of OETEVNM.
If you post what you have coded and explain how it's not working then I'm sure somebody will try and help. |
sorry for the inconvenience caused.
I am from a non-English-speaking country and my english is not so good, sometimes i tried to explain myself clearly but unfortunately am not able to do that, especially when it's complicated.
will explain as much clear and i can as possible later....need to rush to home |
|
Back to top |
|
|
|