Hex search in a VBA file?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Hex search in a VBA file?

Postby BSvihraJr » Tue Mar 18, 2008 6:21 am

I can clarify the requirements if needed.

Basically, I have a variable block file. I need to run through it with a utility that will create a second file with a tally of the number of records that fit a criteria. The criteria is a hex value at a specific position in the record.

Doable?

Thanks!
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby Frank Yaeger » Tue Mar 18, 2008 9:04 pm

Please show an example of your input records and what you expect for output. Give the LRECL of the input file. Give the value of the hex character you want to search for (e.g. X'01'). If there can be more than one such hex character in a record, describe how you want to handle that.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Hex search in a VBA file?

Postby BSvihraJr » Wed Mar 19, 2008 4:33 am

I will update tomorrow morning. Thanks.
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby BSvihraJr » Wed Mar 19, 2008 7:59 am

Can we start with... tallying the number of records in a VB file, 13004 LRCL, and displaying that number in another file?

I tried a few things already, and can't even get past whether to use VTOF or not. When using that, it seemed like I couldn't do anything but the convertion. I read some documentation that said you can't really use it with anything else (overlay, etc).
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby dick scherrer » Wed Mar 19, 2008 8:38 am

Hello,

If you want to use DFSORT to get the count, you can use the technique discussed in the "Display the number of input or output records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/supp ... vs/tricks/
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Hex search in a VBA file?

Postby BSvihraJr » Wed Mar 19, 2008 6:12 pm

//SYSIN    DD   *
   OPTION COPY
   OUTFIL NODETAIL,REMOVECC,TRAILER1=(COUNT=(M11,LENGTH=8))
/*


Results in a SYSOUT containing all input records and no trailer record.

Input file:

LRECL = 13004
TYPE = VBA
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby BSvihraJr » Wed Mar 19, 2008 6:18 pm

This is what I tried for the ultimate scenario.

VBA file in, FB out. Tally in one counter the number of "S" records, and the number of "I" records in another. Omit "S" records with 9999's in a position.

Gives me a RC=16
21 BYTE VARIABLE RECORD IS SHORTER THAN 29 BYTE MINIMUM FOR FIELDS

//SYSIN    DD   *
   OPTION COPY
   OMIT COND=(14,2,CH,EQ,C'S',AND,25,5,CH,EQ,C'99999')
   OUTREC IFTHEN=(WHEN=(14,2,CH,EQ,C'S'),OVERLAY=(13005:C'1')),
          IFTHEN=(WHEN=(14,2,CH,EQ,C'I'),OVERLAY=(13006:C'1'))
   OUTFIL NODETAIL,
          TRAILER1=(TOTAL=(13005,1,ZD,TO=ZD,LENGTH=8),
                    /,
                    TOTAL=(13006,1,ZD,TO=ZD,LENGTH=8))
/*
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby Frank Yaeger » Wed Mar 19, 2008 9:24 pm

You can get past the "short record" error by using:

   OPTION COPY,VLSCMP


I don't know if this will actually give you the output you want and I suspect there's a better way to do what you want to do, but I can't help you since you seem to have a problem with actually describing what you want to do.

Since you didn't specify VTOF and BUILD, your output will be VB, not FB. I could show you how to get an FB output file if I knew what you were trying to do, but again ...
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Hex search in a VBA file?

Postby BSvihraJr » Wed Mar 19, 2008 11:19 pm

I can't release a sample record, as it's confidential.

This is as specific as I can get:

1 input file, 13004 LRECL, VBA

I need one FB ouput file that has a two counts, on two different lines, ex:

00000007
00000003

The first count is of records where a character "S" appears on the 14th position of the record.
However, on the S records, don't include in the count where character "T" also appears in the 19th position.
The second count is of records where a character "I" appears on the 14th position of the record.

That should be sufficient.
BSvihraJr
 
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Hex search in a VBA file?

Postby dick scherrer » Thu Mar 20, 2008 12:15 am

Hello,

You can post sample data as long as you change the "confidential" values to something that doesn't give anything sacred away. We respect protecting controlled data, but we do not appreciate laziness.

When you ask for solutions, you should not try to dictate what is sufficient. If you want help, you should provide the requested info. You could post smaller (say 80 byte) sample data and not 13k and use content that meets your requirement.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post