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

How to find the pattern of string in rexx


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

New User


Joined: 20 Dec 2006
Posts: 5
Location: india

PostPosted: Tue Jan 23, 2007 2:53 pm
Reply with quote

Hi ..
I wanted to search the record for a particular pattern .Is there any function in rexx which will serve my purpose .
The pattern which iam interested is "-1234567-"
The pattern will have hypen followed by some 6 or 7 digits number and a hypen ...
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Tue Jan 23, 2007 4:27 pm
Reply with quote

hi ...

can u define the exact format for the record ...
we can search for a string within a string by using INDEX ...
also we can search for string directly in the dataset by using ISREDIT command

"ISREDIT F FIRST"(string to be searched)
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 23, 2007 4:54 pm
Reply with quote

Something like that?
Code:
/* REXX */                                                             
                                                                       
A = '-1234567-'                                                       
                                                                       
IF DATATYPE(STRIP(A,"B","-"),'W') & LENGTH(STRIP(A,"B","-")) = 7 THEN 
  SAY 'MATCH'                                                         
ELSE                                                                   
  SAY 'MISMATCH'                                                       
                                                                       
EXIT                                                                   
                                                                       


O.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top