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

How to find a character in sequence number


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

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Fri Feb 23, 2007 6:29 pm
Reply with quote

Hi,

I need an rexx code to find whether paticlar character is present in sequence number or not.

my input dataset in open state and i have to type some charactes in sequence numbers. without closing the file, if i executed some rexx commands means it has to print those lines.

Regards,
Mani
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Feb 23, 2007 7:26 pm
Reply with quote

You can use the POS function in REXX.

Code:

CHK = POS('???',FIELD)
IF CHK > 0 THEN DO......


There are two parameters for POS. The 1st parameter is the pattern you are searching for and the 2nd parameter (in your request) would be the variable representing the sequence numbers. If the CHK variable is greater than zero, it found what you were looking for. The valued of the variable CHK is equal to the position of the sequence number where it found a match.

Code:

X = POS('DAY','SATURDAY')

In this example, X would have the value of 6, the position in SATURDAY where the word DAY is found.
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 Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top