Hex search in a VBA file?



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

Re: Hex search in a VBA file?

Postby Frank Yaeger » Thu Mar 20, 2008 1:08 am

BSvihraJr,

Here's a DFSORT job that will do what I think you're asking for. As Dick says, you don't have to show us your actual data ... you can just make up some similar data. The better and sooner you can explain what you want, the more likely you are to get help.

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN    DD    *
   OPTION COPY,VLSCMP
   INCLUDE COND=(14,1,CH,EQ,C'I',OR,
      (14,1,CH,EQ,C'S',AND,19,1,CH,NE,C'T'))
   INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:14,1,6:C'0',7:C'0',5X)),
     IFTHEN=(WHEN=(5,1,CH,EQ,C'S'),OVERLAY=(6:C'1')),
     IFTHEN=(WHEN=NONE,OVERLAY=(7:C'1'))
   OUTFIL NODETAIL,REMOVECC,VTOF,BUILD=(5,8),
     TRAILER1=(TOT=(6,1,ZD,TO=ZD,LENGTH=8),/,
               TOT=(7,1,ZD,TO=ZD,LENGTH=8))
/*
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 » Thu Mar 20, 2008 1:28 am

I'm really sorry. I'm not being lazy, I guess I'm just assuming that saying a VBA file with a character at a certain position is pretty easy to visualize. I'm also not sure what is or is not proprietary in my records, so I'm not sure what I should or should not display. If I'm not being clear, it's because of my lack of experience, not because I have negative intentions.

I did try it myself and post code, so I'm trying here...

Thanks Frank, let me give that a shot.
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 1:51 am

Hello,

If I'm not being clear, it's because of my lack of experience,
Not to worry - the main goal here is for people who don't yet have much experience.

I'm also not sure what is or is not proprietary in my records, so I'm not sure what I should or should not display.
To get around this concern, a good way is to "make up" some data that will demonstrate your requirement, but contains no actual production values. Also, when the "real" data record is long (i.e. 13k), it is easier to work with short samples as long as there is enough data presented to demonstrate the requirement and the desired output.

Good luck :)
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 » Thu Mar 20, 2008 3:21 am

Frank Yaeger wrote:BSvihraJr,

Here's a DFSORT job that will do what I think you're asking for. As Dick says, you don't have to show us your actual data ... you can just make up some similar data. The better and sooner you can explain what you want, the more likely you are to get help.

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN    DD    *
   OPTION COPY,VLSCMP
   INCLUDE COND=(14,1,CH,EQ,C'I',OR,
      (14,1,CH,EQ,C'S',AND,19,1,CH,NE,C'T'))
   INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:14,1,6:C'0',7:C'0',5X)),
     IFTHEN=(WHEN=(5,1,CH,EQ,C'S'),OVERLAY=(6:C'1')),
     IFTHEN=(WHEN=NONE,OVERLAY=(7:C'1'))
   OUTFIL NODETAIL,REMOVECC,VTOF,BUILD=(5,8),
     TRAILER1=(TOT=(6,1,ZD,TO=ZD,LENGTH=8),/,
               TOT=(7,1,ZD,TO=ZD,LENGTH=8))
/*


THANKS!

Took me a few minutes to figure out what BUILD was doing, but that's exactly what I needed and it worked. What does the 5X stand for?
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 » Thu Mar 20, 2008 4:55 am

5X - 5 blanks (X'40').

You can look that kind of thing up in "z/OS DFSORT Application Programming Guide" which is available online along with all of the other DFSORT books at:

http://www.ibm.com/servers/storage/supp ... tmpub.html

If you want to learn more about DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols.
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 Frank Yaeger » Thu Mar 20, 2008 5:02 am

guess I'm just assuming that saying a VBA file with a character at a certain position is pretty easy to visualize.


Well, yes, but it wasn't easy to vizualize what you wanted for output since you didn't show an example of that. We can't read your mind, so it's up to you to make it clear what you want, preferably in your first post asking a question. We shouldn't have to guess. At any rate, now you'll know better next time.
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

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post