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
 

 

How to find a character in sequence number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to find a character in sequence number
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    Post subject: Re: How to find a character in sequence number
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    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 what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm


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