View previous topic :: View next topic |
Author |
Message |
sriramkarumuri Beginner
Joined: 07 Feb 2006 Posts: 28 Topics: 7
|
Posted: Thu Jul 19, 2007 11:49 pm Post subject: Find the String in Record |
|
|
Hi,
i have file with huge records. eace record has the length of nearly 40000bytes.
lets say
123456ABCD........EFGH1....EFGH2....EFGH3....EFGH4....IJKL
i want to find the string EFGH in the above record as well length of n before IJKL.
output should be EFGH1....EFGH2....EFGH3....EFGH4....
Let me know, if you have solutions
Thanks in Advance |
|
Back to top |
|
|
sriramkarumuri Beginner
Joined: 07 Feb 2006 Posts: 28 Topics: 7
|
Posted: Fri Jul 20, 2007 12:36 am Post subject: |
|
|
its a variable length record |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Fri Jul 20, 2007 8:44 am Post subject: |
|
|
Quote: |
eace record has the length of nearly 40000 bytes.
|
sriramkarumuri,
AFAIK Mainframe files are limited to a max LRECL of 32,760 .
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Jul 20, 2007 9:14 am Post subject: |
|
|
sriramkarumuri,
this is an MVS mainframe? What programming languages (and their version) do you have available? also, do you have DFSORT?
and your requirement:- you want to extract data starting with EFGH1 and ending with the character before IJKL.
- EFGH1 will always be in the record
- IJKL will always be in the record and following EFGH1
- neither EFGH1 nor IJKL appears more than once in a record
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
sriramkarumuri Beginner
Joined: 07 Feb 2006 Posts: 28 Topics: 7
|
Posted: Sat Jul 21, 2007 5:28 am Post subject: |
|
|
I want to extract data starting with EFGH1 and ending with the character before IJKL |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sat Jul 21, 2007 8:23 am Post subject: |
|
|
That's one out of 6 questions answered.
Is this MVS mainframe
What languages (and their VSN,) do you have availabele.
Do you have DFSORT
2. EFGH1 will always be in the record
3. IJKL will always be in the record and following EFGH1
4. neither EFGH1 nor IJKL appears more than once in a record _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Sat Jul 21, 2007 8:26 am Post subject: |
|
|
This should be quite interesting, as Kolusu as quite correctly pointed out that the record length exceeds 32,760. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sat Jul 21, 2007 9:20 am Post subject: |
|
|
Code: |
within the record find the starting positions
of 'EFGH1' (save as integer STPOS_EFGH1)
and 'IJKL' (save as integer STPOS_IJKL).
IF STPOS_EFGH1 > ZERO
AND STPOS_IJKL > ZERO
AND STPOS_IJKL > STPOS_EFGH1
THEN
MOVE the data from start-of-record (offset STPOS-EFGH1)
for a length of (STPOS_IJKL - STPOS_EFGH1) to your receiving area
END-IF
|
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
sriramkarumuri Beginner
Joined: 07 Feb 2006 Posts: 28 Topics: 7
|
Posted: Thu Jul 26, 2007 9:11 pm Post subject: |
|
|
Hi Dick,
Can you give me more picture on this
How to get the start position or offset? Is there any string functions available for this? |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Jul 27, 2007 12:45 am Post subject: |
|
|
sriramkarumuri,
Answer these 6 questions:- Is this MVS mainframe?
- What languages (and their VSN,) do you have available?
- Do you have DFSORT?
- will EFGH1 always be in the record?
- will IJKL always be in the record and following EFGH1?
- will either EFGH1 or IJKL appear more than once in a record?
very hard to answer your question without knowing the answer to 2.
I will not provide/suggest a solution until I have 6 satisfactory answers from you.
Then, there will be many members of this forum in addition to me who can provide you a solution(s).
bis dann! _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
|
|