Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Find a string in PS file opened in br... mukkas CLIST & REXX 2 Sat Feb 24, 2018 2:15 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us