View previous topic :: View next topic
|
Author |
Message |
saraswathis
New User
Joined: 06 Sep 2006 Posts: 8
|
|
|
|
I wish to find the last occurence of space(' ') in a string. Does anyone know? Also is there any function to find the number of occurences of a char in a string? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
When posting a new question, please start a new topic.
I've split this question from the previous topic. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Why is this in the DB2 forum?
Do you need to answer this question from within a SELECT, like:
SELECT * FROM TABLE WHERE "last occurence of space" > 5 ?
Or do you want to do this in COBOL ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
From what i saw, it is for a DB2 SELECT rather than COBOL.
I believe the desired result is twofold:
1. how many spaces are in the string
2. the postition of the last space |
|
Back to top |
|
|
saraswathis
New User
Joined: 06 Sep 2006 Posts: 8
|
|
|
|
Exactly !!!. I need the number of occurences of the spaces in a string. And i want to find out the last occurence of the space. This needs to be run on MainFrame - DB2.
Thnks in adv |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Will this "select" be done inside a cobol program?
If so, my recommendation is that you select the needed rows(s) from DB2 and then parse them in the cobol code for the space count/last position.
Gives you the advantage of simply modifying the code if the requirement ever grows/changes as well as it could be running yet today. Given that no one has posted a select yet (since the 8th), and this is the DB2 forum, it may be a bit before a suggestion is posted. . . |
|
Back to top |
|
|
|