IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help on sorting when the position of the field varies


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ARUN.A.NAIR
Warnings : 1

New User


Joined: 07 Mar 2007
Posts: 12
Location: MAHARASHTRA

PostPosted: Wed Jun 25, 2008 3:57 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 25, 2008 8:33 pm
Reply with quote

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
View user's profile Send private message
ARUN.A.NAIR
Warnings : 1

New User


Joined: 07 Mar 2007
Posts: 12
Location: MAHARASHTRA

PostPosted: Thu Jun 26, 2008 2:00 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 26, 2008 8:08 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top