Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need help on sorting when the position of the field varies

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need help on sorting when the position of the field varies
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

Site Director


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

PostPosted: Wed Jun 25, 2008 8:33 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jun 26, 2008 8:08 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us