JCL IF statement on multiple lines

1.3k views Asked by At

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 :)

2

There are 2 answers

0
Joren Willems On BEST ANSWER

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.

2
Andrew Henle On

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