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
 

 

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
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 REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm


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