Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Checking for single code i.e ' in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Checking for single code i.e ' in Rexx
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

Senior Member


Joined: 14 Mar 2007
Posts: 10546
Location: italy

PostPosted: Sat Jan 10, 2015 5:07 pm    Post subject: Reply to: Checking for single code i.e ' in Rexx
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to write a REXX to see whether da... javen777 CLIST & REXX 1 Wed Dec 19, 2018 11:36 am
No new posts Error when compiling a REXX exec with... Ricardo Viegas CLIST & REXX 2 Tue Dec 18, 2018 5:44 am
This topic is locked: you cannot edit posts or make replies. How to process gdg in rexx program wh... pkmurali CLIST & REXX 12 Thu Dec 13, 2018 10:08 am
No new posts calling java code(on mainframe from c... elixir1986 COBOL Programming 1 Fri Nov 30, 2018 1:57 am
No new posts Single step to take backup of multipl... Vignesh Sid JCL & VSAM 1 Thu Nov 29, 2018 8:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us