View previous topic :: View next topic |
Author |
Message |
k2 Beginner
Joined: 21 Jan 2004 Posts: 7 Topics: 3
|
Posted: Fri Apr 16, 2004 10:20 am Post subject: Conditional Execution of Jobs with Dialog Manager |
|
|
I am trying to conditionally execute a second job, based on the return code of the first job, where the JCL is submitted via Dialog Manager. I have had success with the basic code outside of a skeleton, but I cannot get the )SEL block to recognize my IF-THEN JCL statement:
Code: |
)SEL
//JOB1 JOB (ACCT.....)
//STEP1 EXEC PGM=SAS
//.....
//SYSIN DD DSN=.....
// IF RC <= 4 THEN
//STEP2 EXEC PGM=IEBGENER
//SYSUT1 DD DATA,DLM=$$
//JOB2 JOB (ACCT.....)
//STEP2 EXEC PGM=SAS
//.....
//SYSIN DD DSN=.....
$$
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
// ENDIF
)ENDSEL
|
When submitted, only the first four lines of the SEL block are sent to execute. The IF-THEN statement and everything after that are ignored. If I remove just the IF-THEN statement and then edit the JCL that is generated from the skeleton to replace it, everything works just as I want it to.
I cannot find any information about conflicts between the )SEL block in Dialog Manager and the IF-THEN JCL construct. Does anyone have any ideas why I cannot get this to work?
Thanks in advance for your assistance,
K2 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Apr 16, 2004 10:38 am Post subject: |
|
|
K2,
Are you writting the generated JCL to a file or are your directly sending it to the intrdr?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
k2 Beginner
Joined: 21 Jan 2004 Posts: 7 Topics: 3
|
Posted: Fri Apr 16, 2004 11:04 am Post subject: |
|
|
It's being directly sent to the intrdr.
K2 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Apr 16, 2004 11:28 am Post subject: |
|
|
K2,
The default properties of sysout are recfm=fba and the lrecl is dependent on the program that is being used. Since the recfm is FBA the first byte is a carriage control character and that might be causing the error. Hardcode RECFM=FB on the output statement while generating the jcl. Let us say your output dd name is SYSUT2 then code as follows.
Code: |
//SYSUT2 DD SYSOUT=(*,INTRDR),RECFM=FB
|
Alternatively you can write the generated JCl to a File and then submit the job from the file.
Code: |
//LASTSTEP EXEC PGM=IKJEFT01,
// PARM='SUBMIT TID.GENERATED.JCL'
//SYSTSPRT DD SYSOUT=*
|
Or you can use rexx to submit jcl. check this topic.
http://www.mvsforums.com/helpboards/viewtopic.php?t=1415&highlight=submit
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
k2 Beginner
Joined: 21 Jan 2004 Posts: 7 Topics: 3
|
Posted: Fri Apr 16, 2004 12:32 pm Post subject: |
|
|
Hi Kolusu,
Thanks for the different options. Unfortunately, the system doesn't even seem to get to the SYSUT card. When I preview the code generated by the ISPF Dialog Manager, it ends with the first SYSIN card. It completely ignores everything after that. If I remove that single statement, the preview shows all the remaining lines in the Select Block. It just seems that there is a conflict between the )SEL statement and the IF-THEN JCL statement that seems to be the problem.
Thanks again,
K2 |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Fri Apr 16, 2004 2:40 pm Post subject: |
|
|
K2, I'm just clutching at straws here, but could you please post the whole of the first part of your skeleton (i.e. don't give us the "....."; give us the full line).
Chances are it won't help, but ...... _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Fri Apr 16, 2004 4:13 pm Post subject: |
|
|
Since your problems relate to the IF statement, perhaps you could revert to the old method and use COND=(4,LE) on STEP2. Perhaps ISPF has an error seeing the IF statement as JCL. |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Sun Apr 18, 2004 7:48 pm Post subject: |
|
|
Change your IF logic to use LE rather than <=
< is a symbol which has meaning in skeletons (much in the same way that an & indicates the beginning of a variable name). _________________ My opinions are exactly that. |
|
Back to top |
|
|
RobertL Beginner
Joined: 18 Nov 2003 Posts: 22 Topics: 0 Location: Lisbon, Portugal
|
Posted: Mon Apr 19, 2004 7:28 am Post subject: |
|
|
Hello K2,
Your CLIST/REXX program needs to do some error checking after executing the FTINCL service to detect any errors that occur. Other than that, the skeleton should be changed from:
to:
Code: | // IF RC <<= 4 THEN |
By default the < character is used to indicate the beginning of a conditional variable substitution sequence <&var.nonblank|blank> so FTINCL is assuming that whatever follows the < will be in the above format. Alternatively, you could change the default control character for this by specifying the )DEFAULT command at the beginning of the skeleton. The default control characters are as follows and are what you get if you don't specify the )DEFAULT command
I frequently use the following command to change the defaults for < and > to |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Mon Apr 19, 2004 6:52 pm Post subject: |
|
|
Hey Robert, don't you read before posting?
I already said that (albeit in fewer words). _________________ My opinions are exactly that. |
|
Back to top |
|
|
|
|