0

I'm getting JCL error when executing this job.

// IF &O = O AND                              
//       (&GEG = SD.SD.SYNC.DB2.LBER OR       
//        &GEG = SD.LA.SYNC.DB2.LBER OR       
//        &GEG = SD.TW.SYNC.DB2.LBER)         
//STEP015 EXEC COZ,PNAME=IN0603ZC

Expected continuation not found. When I type '+' after every line for the IF, the total length is greater than 80 which also gives problems. Please help me :)

Joren Willems
  • 167
  • 1
  • 6
  • 12
  • 1
    You know that you can only test for numerics? O is not numeric. If those long things are data set names, you can't do that. If they're not data set names, what are they? What are you actually trying to do? I think you have not attempted to understand a JCL IF statement, and think that you can just jam in anything you like. You can't. – Bill Woodger Dec 27 '16 at 16:23
  • I'm assuming you've just not showed the ENDIF. – Bill Woodger Dec 27 '16 at 16:23
  • I also don't understand what you mean about the +. Can you show that, and the message you get when 80 gives you a problem? – Bill Woodger Dec 27 '16 at 16:31
  • @Bill: Indeed, the ENDIF isn't shown – Joren Willems Dec 27 '16 at 19:37
  • &O is the environment we are testing in. O stands for development (in Dutch it is "Ontwikkeling"). The names after the &GEG are names of MQ's. We are using a tool called Dialog Manager which determines in which environment you are testing (development, acceptation, production). I've written a new program called IN0603ZC. It's only yet in development stage. With this JCL I'm trying to say: "If we're in development AND one of 3 MQ names in the IF statement is chosen THEN execute my new program IN0603ZC. – Joren Willems Dec 27 '16 at 19:42
  • Well, you'll have to arrange it differently. The IF in JCL is not a general-purpose "if" like you think it is. Have a look at the JCL Reference. Read about the IF. If still unsure of a way to proceed, update your question with the information in the comment, and what it is that is unclear about your understanding of the JCL IF. – Bill Woodger Dec 27 '16 at 22:09

2 Answers2

1

Per the z/OS MVS JCL syntax reference:

//[name] IF  [(]relational-expression[)] THEN   [comments]
    .
    .    action when relational-expression is true
    .
//[name] ELSE   [comments]
    .
    .    action when relational-expression is false
    .
//[name] ENDIF   [comments]

The IF statement consists of the characters // in columns 1 and 2 and the five fields: name, operation (IF), the relational-expression, the characters THEN, and comments. The relational-expression can be enclosed in parentheses.

The ELSE statement consists of the characters // in columns 1 and 2 and the three fields: name, operation (ELSE), and comments.

The ENDIF statement consists of the characters // in columns 1 and 2 and the three fields: name, operation (ENDIF), and comments.

Your JCL is missing THEN

Andrew Henle
  • 32,625
  • 3
  • 24
  • 56
0

We had to create another solution. Like Bill Woodger said before: You can test only on numerics in a JCL. Thankx all for your help.

Joren Willems
  • 167
  • 1
  • 6
  • 12