View previous topic :: View next topic
|
Author |
Message |
ARUN.A.NAIR Warnings : 1 New User
Joined: 07 Mar 2007 Posts: 12 Location: MAHARASHTRA
|
|
|
|
Hi,
I have a VB file which has a record length if 29000. The file's data is divided into different segment with segment headers. That is, it can have segment headers as 'B1','B2'... It is not necessary that every records need have all of the segments and there is no order specifying where each of the segments should come. Even the segments can be repeated. I need to sort out all records which has 'BA' as segment header with the condition that 48 th column from the position where 'BA' segment header is found should be '82'.
Is there any way this can be implemented through SYNCSORT? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to provide much better info regarding the structure of the input file. Other than looking for 82 located 48-bytes away from the BA segment header, nothing is defined. . .
How long is a segment header? What identifies a segment header? Hopefully, not B1, B2, etc as those values might also appear in the data.
You don't need to post 29k records, but you should post some sample input records that demonstrate conditions like the real input. |
|
Back to top |
|
|
ARUN.A.NAIR Warnings : 1 New User
Joined: 07 Mar 2007 Posts: 12 Location: MAHARASHTRA
|
|
|
|
I am sorry that I missed these data's..
The segment header is just one byte long. The 2 bytes following the header has the length of the segment. The rest fields are the data for the segment.
Luckily, the segment header values are unique, in the sense, it will not appear in the data part.
The following is a sample record from the file
Code: |
£..03673.......2008-06-2202:03:2303673000 D100
B10FFFFF000FFFFFFFF6FF6FFFF7FF7FFFFFFFFFF444444444444444444444444
10C03673000FFFF200800602202A03A230367300000000000000000000000 |
The above record is starting with a 'B1' segment and has a length of 100. The fields following it are the data for B1 segment.
My requirement relating to the previous row is to fetch all records in the file which '82' as value in the 42 nd field from the starting position of 'B1' segment, provided the starting position of the 'B1' segment is not known. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your example has no "82 that is 42 bytes away" that i can see?
Please post more complete input as well as the output you want from that input.
Is your file not only variable length, but within each record maintains a second set of "lengths"?
It will help if you use example data that shows more than one "header" in the records - use smaller records to show your requirement. When you post data, use the "Code" tag to preserve alignment and make the post more readable (i've "Code"ed your previous data post. |
|
Back to top |
|
|
|