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: 10211
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 Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am


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