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

Counting records...variable field position


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Tyler

New User


Joined: 25 Nov 2006
Posts: 2
Location: Toronto

PostPosted: Thu Jan 18, 2007 2:36 am
Reply with quote

I have a VB file with 2 pieces of data that I am trying to sort. The records are formatted like this:

001aaabbbcccLLLLvvvvvparam1vvvvvparam2vvvv

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
##,zzz,aaa
##,zzz,bbb
##,zzz,ccc
##,yyy,aaa
##,yyy,bbb

Can I sort the file and count records based on the length LLLL to find param2?

I fully expect the answer No.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 4:10 am
Reply with quote

I'm not really clear on your problem, but I'm thinking that this is not a "utility" solution. Me thinks that this will need a progam.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 18, 2007 4:34 am
Reply with quote

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.
Back to top
View user's profile Send private message
Tyler

New User


Joined: 25 Nov 2006
Posts: 2
Location: Toronto

PostPosted: Thu Jan 18, 2007 9:48 pm
Reply with quote

The LRECL is 5917 and the data is not delimited.

The values assigned to the length of the variable record (0000005B below) varies from x'50' to x'300' and varies based on an input string captured from the user.

The data in positions 1-162 are fixed but irrelevant. This starts at pos 163:
Code:
...$000 X=(98223168,v750_
0005FFF4E74FFFFFFFF6AFFF6
000B00007ED98223168B5750D

v750 is param1 that I need.

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
Code:
020E009
FFFCFFF
0205009

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...
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top