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

Checking for single code i.e ' in Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Sat Jan 10, 2015 4:50 pm
Reply with quote

I want to check whether the single code is present in string or not at 7th position. So I am using as below


Code:
SUBSTR(arg1,7,1) = "'"



But this is not working. Also I cannot put the single code in two single codes.


Please check and share your thoughts.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jan 10, 2015 5:07 pm
Reply with quote

Quote:
But this is not working.


how sad, I hope that You will be able to fix it icon_cool.gif

unless You learn to post meaningful information all You will get will be sarcastic remarks

Code:

/* rexx*/

arg1 = "1234567890"
say substr(arg1,7,1)
if substr(arg1,7,1) = "'" then,
   say "GOT IT"
else ,
   say "WTF"

arg1 = "123456'890"
say substr(arg1,7,1)
if substr(arg1,7,1) = "'" then,
   say "GOT IT"
else ,
   say "WTF"

exit


Code:

7
WTF
'
GOT IT
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top