Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare alphabetic variables in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
migueysan

New User


Joined: 30 Jun 2008
Posts: 2
Location: Buenos Aires, Argentina

PostPosted: Wed Sep 10, 2008 5:50 pm    Post subject: Compare alphabetic variables in JCL
Reply with quote

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 10, 2008 11:54 pm    Post subject:
Reply with quote

Hello migueysan and welcome to the forums,

I'm not sure why, but your topic was locked and in the "Off Topics" part of the forum.

At the top of the page is a link to "IBM Manuals". Among them is the jcl reference.

Start here (from that link) and look around:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/iea2b650/17.1.4.5?

Basically, your code violates the "rules".
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Thu Sep 11, 2008 12:20 am    Post subject:
Reply with quote

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

New User


Joined: 30 Jun 2008
Posts: 2
Location: Buenos Aires, Argentina

PostPosted: Thu Sep 11, 2008 12:22 am    Post subject:
Reply with quote

So there is no way I can check the contents of an alphabetical variable? icon_question.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Thu Sep 11, 2008 12:36 am    Post subject:
Reply with quote

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 11, 2008 2:38 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 6 Thu Aug 17, 2017 7:13 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts fuzzy compare Martylin JCL & VSAM 9 Thu Mar 30, 2017 2:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us