View previous topic :: View next topic
|
Author |
Message |
migueysan
New User
Joined: 30 Jun 2008 Posts: 2 Location: Buenos Aires, Argentina
|
|
|
|
Hi to all
I have the following problem
//IFPREG IF &TIPO EQ ORD THEN
// CLASE='A4_'
//IFPREG ENDIF
&TIPO is a parameter which may have the values OLD u ORD. Problem is:
a) If I don't use apostrophes, I got the following error:
55 //IFPREG IF &TIPO EQ ORD THEN
IEFC653I SUBSTITUTION JCL - OLD EQ ORD
56 // CLASE='A4_'
57 //IFPREG ENDIF
STMT NO. MESSAGE
55 IEFC013I ERROR IN IF STATEMENT: OLD NOT VALID
56 IEFC605I UNIDENTIFIED OPERATION FIELD
b) If I use apostrophes, I got this:
55 //IFPREG IF &TIPO EQ 'ORD' THEN
IEFC653I SUBSTITUTION JCL - OLD EQ 'ORD'
56 // CLASE='A4_'
57 //IFPREG ENDIF
STMT NO. MESSAGE
55 IEFC629I INCORRECT USE OF APOSTROPHE ON THE IF STATEMENT
55 IEFC629I INCORRECT USE OF APOSTROPHE ON THE IF STATEMENT
56 IEFC605I UNIDENTIFIED OPERATION FIELD
c) If I use double quotes, I got this:
55 //IFPREG IF &TIPO EQ "ORD" THEN
IEFC653I SUBSTITUTION JCL - OLD EQ "ORD"
56 // CLASE='A4_'
57 //IFPREG ENDIF
STMT NO. MESSAGE
55 IEFC620I UNIDENTIFIABLE CHARACTER " ON THE IF STATEMENT
55 IEFC620I UNIDENTIFIABLE CHARACTER " ON THE IF STATEMENT
56 IEFC605I UNIDENTIFIED OPERATION FIELD
Can anybody help? Thanks to all |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The manual states that only selected items are allowed in the JCL IF statement -- OLD (or &TIPO) is not one of them. Your IF statement cannot work as constructed, no matter WHAT you do to it. |
|
Back to top |
|
|
migueysan
New User
Joined: 30 Jun 2008 Posts: 2 Location: Buenos Aires, Argentina
|
|
|
|
So there is no way I can check the contents of an alphabetical variable? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
//[name] IF [(]relational-expression[)] THEN [comments]
.
. action when relational-expression is true
.
//[name] ELSE [comments]
.
. action when relational-expression is false
.
//[name] ENDIF [comments] |
is the syntax according to the JCL LR manual.
and further in the manual is:
Quote: |
17.1.4.5 Relational-Expression Keywords
The following keywords are the only keywords supported by IBM and recommended for use in relational-expressions. Any other keywords, even if accepted by the system, are not intended or supported keywords.
Keyword Use
RC
indicates a return code
ABEND
indicates an abend condition occurred
¬ABEND
indicates no abend condition occurred
ABENDCC
indicates a system or user completion code
RUN
indicates that the specified step started execution
¬RUN
indicates that the specified step did not start execution |
As long as you use RC, ABEND, ABENDCC, RUN, ¬ABEND, ¬RUN you can do all the IF tests you want. I do not see "OLD" on this list, and IBM doesn't promise any support in that case. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you post a more complete example of what you want to accomplish, someone may have a suggestion. Exlain the steps in the run and what needs to be tested. Do not focus on specific syntax until we all understand what we are trying to do. |
|
Back to top |
|
|
|