View previous topic :: View next topic
|
Author |
Message |
rahul.arora
New User
Joined: 09 Jul 2011 Posts: 9 Location: India
|
|
|
|
I have a flat file which contains records in normal format...I want to make a search on the records based on their hex code (means I need a records which have hex value less than 04)...
My query is
I have records in normal format...now i want to make a search on hex code...so to do this should i have to make a new input file which contains hex codes of those records....or we can search directly???[/list] |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Records or columns ?
What have you tried so far. SUPERC should suffice |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
rahul.arora wrote: |
I have a flat file which contains records in normal format...I want to make a search on the records based on their hex code (means I need a records which have hex value less than 04)...
My query is
I have records in normal format...now i want to make a search on hex code...so to do this should i have to make a new input file which contains hex codes of those records....or we can search directly???[/list] |
Every byte of every file, no matter what type of file, is "normal". Every byte is made of 8 bits, each of which can have a value 0 or 1, allowing a binary representation of any value from 0 to 255. Because eight-digt binary numbers (base 2) are quite clumsy to use, (00000000 to 11111111) we use base 16 and a notation called hexadecimal, where each four bits of the byte it represented by the digits 0-9 and A-F.
Every file is "normal" and every file is "hexadecimal".
If you want to search for values in hexadecimal, all you need is something that allows you to express your selection in hexadecimal. You do not need a different input file. You can search directly. |
|
Back to top |
|
|
rahul.arora
New User
Joined: 09 Jul 2011 Posts: 9 Location: India
|
|
|
|
The file has around 2000 records and 15-20 columns...
I tried to copy the records through SORT FIELDS=COPY...
But the thing is I need records which has hex code 00,01,02 and 03..And they are coming randomly in any column of the record...
First tell me one thing
I have input file which has records in alphanumeric but i want to make a search basis on hex code....Is it Possible? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What do you mean the file has 15-20 columns?
Determine which sort product you have.
Consult the documentation for that product.
If you can find something that allows you to "scan" for values at a variable location, then you are home free. Try X'00', X'01' etc for the values you are trying to locate.
If you want to search for alphanumerics in hex, each letter and each number has a hex value associated with it. x'F1' is 1, x'C1' is A.
It is possible to search a file in hexadecimal no matter what that file contains. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Post some actual input data and the output you want then this sample is processed.
You can probably get the result you want using your sort product, but you need to provide better info. You also need to menton the recfm and lrecl of the files. |
|
Back to top |
|
|
|