I have to delete first occurence of string from input file (Record format : VBA and LRECL=1024). I want to search particular hex value in the file and omit only that record.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Which do you want to do? Omit a record or delete some data?
Can you show some sample input and expected output, please?
SS on OMIT/INCLUDE or FINDREP are likely to be what you want, but as Pandora-Box is hinting, if you are going for a hex value, you have to be really sure it can't just exist naturally in a packed/binary field on a record.
Hex value will pe at position 1 in the file. But it doesn't appear only in one record. It can be present in many records.
I want to delete record when the hex value appears first time.
I tried below card :
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, you won't be able to use INCLUDE/OMIT.
You could use IFTHEN=(WHEN=(logexp with SS and OVERLAY a SEQNUM, then on OUTFIL OMIT get rid of the record which has a sequence number of one, and shorten the records to drop the sequence number.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
What's going on here? TS's data doesn't match their words, and we're coming with code? :-)
The test data shown is variable-length.
The hex value (which is actually "+,;"), where it is shown, is at a fixed position (despite the request to "search") of 13,3 in a VBA.
I don't know why the GROUP is being used. Why not logexp and a simple OVERLAY (there is no need to propagate data across other records, or to use ID, or whatever, unless I'm missing something).
Padora-Box at least has RECORDS=1 (although, as a comment, through typo).
Isn't all we need to know is that it is the first occurrence of the thing? No need for first occurrence of first group, is there?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Escapa wrote:
This should get you what needed...
Pandora-Box wrote:
May be slightly better
I really appreciate your enthusiasm to help with solutions, but please pay attention to RECFM of OP. Both of your solutions will make all the records in the Variable block file to have the max length , there by ruining the very concept of VB files. Try displaying the RDW before and after your jobs and see how the RDW is updated to the max value. Moreover you have complicated a simple request. You really don't need WHEN=GROUP in here.
Bill Woodger wrote:
The hex value (which is actually "+,;"), where it is shown, is at a fixed position (despite the request to "search") of 13,3 in a VBA.
For VBA files the actual data starts in position 6 as the first 5 bytes have( 4 bytes RDW + 1 byte Carriage control character). So if you add a seqnum for 8 bytes the search key begins at 14.
snehal,
Use the following DFSORT JCL which will give you the desired results.