MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

if statement with alphanumeric value

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
jctgf
Beginner


Joined: 05 Nov 2006
Posts: 89
Topics: 36

PostPosted: Mon Aug 31, 2009 6:53 pm    Post subject: if statement with alphanumeric value Reply with quote

Hi,

I'm used to do this:
Code:

// IF &P = 1 THEN
//STEP1 EXEC ...
// ENDIF


But I'd like to do this:

Code:

// IF &P = 'ABC' THEN
//STEP1 EXEC ...
// ENDIF
 

Is it possible to compare a symbolic parameter to an alphabetic value?

Thanks.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 31, 2009 7:52 pm    Post subject: Reply with quote

jctgf,

You cannot directly compare a alphabetic value, however you can code in a small rexx exec which will read ur parm and set the numerical return code and you can use that to run your other steps

Code:

//MYPROC   PROC P=' '                         
//STEP0100 EXEC PGM=IKJEFT01,PARM='%JCTGF &P'
//SYSTSPRT DD SYSOUT=*                       
//SYSPRINT DD SYSOUT=*                       
//SYSTSIN  DD DUMMY                           
//SYSEXEC  DD DSN=any pds with a member named JCTGF,DISP=SHR   
//*
// IF RC = 1 THEN                                           
//STEP1 EXEC ...
// ENDIF
// PEND                                       
//GO       EXEC MYPROC,P='ABC'               


REXX EXEC
Code:

/* REXX */                             
PULL ARG                               
SELECT                                 
  WHEN(ARG(1) = 'ABC') THEN RETURN 1   
  WHEN(ARG(1) = 'DEF') THEN RETURN 2   
  WHEN(ARG(1) = 'EFG') THEN RETURN 3   
  OTHERWISE RETURN 4                   
END                                     

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group