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: 10231
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm


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