I have a VB file with 2 pieces of data that I am trying to sort. The records are formatted like this:
LLLL=length of variable record to param2 (value in HEX) in a fixed position
vvvv=variable length data
param1=first parameter I need to sort on. These fields are within a few bytes depending on the record and are unique enough that I can sort them based on a range of positions (ie. 98-109)
param2=second parameter I need to sort. The location is LLLL bytes from the end of LLLL (start of the variable length) and is 3 digits which looks like other data nearby.
The results that I am looking for should indicate the following:
count, param1, param2
Can I sort the file and count records based on the length LLLL to find param2?
What values can appear in LLLL? Are we talking 5 different values or 100 different values or what? Can you narrow it down to a range like 0005-0010?. I'm thinking that if it's a "reasonable" number, we could use DFSORT's IFTHEN clauses to extract the sort fields differently for the different LLLL values so we can operate on param2.
What is the LRECL of the input file?
It would really help if you would show an example of the input records with actual values and the expected output records with actual values.
I assume these values aren't delimited in some way from each other (e.g. commas between them or some other pattern)? If they were, we could use DFSORT's PARSE function.
The variable length portion starts with the 000 at position 167 and continues for a length of x'5b' (d'91') bytes. At position 258 (167+91) is
The 020 is the param2 that I am after.
The more I look at this, the more I realize that I will have to write a program to extract the data from each record and tally the records based on the param2. I had hoped to run the utility against the file to be able to knock out the report but there ya go.
Thanx for your input and letting me talk through it...