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
 

 

Counting records...variable field position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Counting records...variable field position
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: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 4:10 am    Post subject:
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 Moderator


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

PostPosted: Thu Jan 18, 2007 4:34 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am


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