MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conditional Execution of Jobs with Dialog Manager

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
k2
Beginner


Joined: 21 Jan 2004
Posts: 7
Topics: 3

PostPosted: Fri Apr 16, 2004 10:20 am    Post subject: Conditional Execution of Jobs with Dialog Manager Reply with quote

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


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Apr 16, 2004 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
k2
Beginner


Joined: 21 Jan 2004
Posts: 7
Topics: 3

PostPosted: Fri Apr 16, 2004 11:04 am    Post subject: Reply with quote

It's being directly sent to the intrdr.

K2
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Apr 16, 2004 11:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
k2
Beginner


Joined: 21 Jan 2004
Posts: 7
Topics: 3

PostPosted: Fri Apr 16, 2004 12:32 pm    Post subject: Reply with quote

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


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Apr 16, 2004 2:40 pm    Post subject: Reply with quote

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


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Fri Apr 16, 2004 4:13 pm    Post subject: Reply with quote

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


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Sun Apr 18, 2004 7:48 pm    Post subject: Reply with quote

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


Joined: 18 Nov 2003
Posts: 22
Topics: 0
Location: Lisbon, Portugal

PostPosted: Mon Apr 19, 2004 7:28 am    Post subject: Reply with quote

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:
Code:
// IF RC <= 4 THEN

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
Code:
)DEFAULT  )&?!<|>

I frequently use the following command to change the defaults for < and > to
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Apr 19, 2004 6:52 pm    Post subject: Reply with quote

Hey Robert, don't you read before posting?

I already said that (albeit in fewer words). Smile
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group