MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find the String in Record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sriramkarumuri
Beginner


Joined: 07 Feb 2006
Posts: 28
Topics: 7

PostPosted: Thu Jul 19, 2007 11:49 pm    Post subject: Find the String in Record Reply with quote

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
View user's profile Send private message
sriramkarumuri
Beginner


Joined: 07 Feb 2006
Posts: 28
Topics: 7

PostPosted: Fri Jul 20, 2007 12:36 am    Post subject: Reply with quote

its a variable length record
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Jul 20, 2007 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jul 20, 2007 9:14 am    Post subject: Reply with quote

sriramkarumuri,

this is an MVS mainframe? What programming languages (and their version) do you have available? also, do you have DFSORT?

and your requirement:
  1. you want to extract data starting with EFGH1 and ending with the character before IJKL.
  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
View user's profile Send private message
sriramkarumuri
Beginner


Joined: 07 Feb 2006
Posts: 28
Topics: 7

PostPosted: Sat Jul 21, 2007 5:28 am    Post subject: Reply with quote

I want to extract data starting with EFGH1 and ending with the character before IJKL
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sat Jul 21, 2007 8:23 am    Post subject: Reply with quote

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
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Sat Jul 21, 2007 8:26 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sat Jul 21, 2007 9:20 am    Post subject: Reply with quote

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
View user's profile Send private message
sriramkarumuri
Beginner


Joined: 07 Feb 2006
Posts: 28
Topics: 7

PostPosted: Thu Jul 26, 2007 9:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jul 27, 2007 12:45 am    Post subject: Reply with quote

sriramkarumuri,

Answer these 6 questions:
  1. Is this MVS mainframe?
  2. What languages (and their VSN,) do you have available?
  3. Do you have DFSORT?
  4. will EFGH1 always be in the record?
  5. will IJKL always be in the record and following EFGH1?
  6. 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group