manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
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 |
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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. |
|