IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

"Not Equal To" condition in JCL 'IF'


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mrgnndhmk

New User


Joined: 01 Feb 2006
Posts: 51
Location: India

PostPosted: Thu Feb 18, 2010 12:58 am
Reply with quote

Hi All,

My parameter "PARAMA" would contain a string value during some runs of JCL.

I have to skip steps if the parameter value is space.

I am trying to execute

IF &PARAMA NE ''
GOTO STEP005

But NE is not accepted by JCL.

Can anybody help?

Thanks in advance.

Regards,
Muruganandham k
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Feb 18, 2010 1:05 am
Reply with quote

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
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Feb 18, 2010 1:07 am
Reply with quote

deleted -- I type to slow.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Feb 18, 2010 1:08 am
Reply with quote

I have experimented with the following but, it's an undocumented "feature" which could be fixed by IBM at anytime -

Code:

//VARS SET VALUE1=1,VALUE2=0
// IF  &VALUE1=&VALUE2

What happens is VALUE1 resolves as 1 and VALUE2 resolves as 0 and in this example, the IF check would be false.

Code:

// IF  1=0

Otherwise, I can't resolve what you want to do because I've only experimented with numbers and equal-to conditions and I don't believe GOTO's are valid either.

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 18, 2010 1:28 am
Reply with quote

Hello,

You could create a new "first step" that looks at the parm and sets the Return Code accordingly.

Then the remainder of the job simply uses the RC that was set. . .
Back to top
View user's profile Send private message
mrgnndhmk

New User


Joined: 01 Feb 2006
Posts: 51
Location: India

PostPosted: Thu Feb 18, 2010 2:39 am
Reply with quote

Thanks for the suggestions.

In my shop, I can use the following

|IF &ECHECK EQ ''

<JCL STEPS>

|ENDIF

But I have to set ECHECK before the job card

|SET &ECHECK=&&PARAMA

where &&PARAMA is a Scheduler variable.

Now I am able to achieve what I wanted, though not using NE condition.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
Search our Forums:

Back to Top