Posted: Sat Mar 08, 2014 12:05 am Post subject: HOW TO EXTRACT TWO DATA IMBEDDED IN ONE BYTE
Hi, I have two fields that are imbedded in one byte of data in my input file. Each field occupy 4 bits. That byte of data is in binary format. I would like to use DFSORT to extract that 1 byte of data into 2 differents fields in my output file. But, I cannot figure out how to do it. So is there anybody could help me please.
Here is my data (1 line). The 1rst line contains data displayed without 'HEX ON', whereas the 2nd and 3rd lines represent the data in 'HEX MODE'
.*F512 <== line without 'HEX ON' mode
25CFFF --| <== line with 'HEX ON'
I want to extract the 1rst byte data which contains the value 23 in HEX MODE display into 2 fields in the output file. The 1rst field in the output file will contian the value 2 and the 2nd field in the output file will contain the value 3.
So my output file should be like this:
23*F512 <== line without 'HEX ON' mode
FF5CFFF --| <== line with 'HEX ON'
Thank you for your help. But, I still don't catch what you are trying to say.
The thing is that even if we convert it into a 1 byte HEX format, I am still wondering how can I split the 2 data that are embedded in that 1 byte into my output file.
Joined: 24 Jul 2011 Posts: 651 Location: Down on the pig farm
Posted: Sun Mar 09, 2014 5:23 pm Post subject:
If you have not already done so then how about reading the manual? There is a link to the relevant update in the "sticky" at the head of this section of the forum labelled "New DFSORT/ICETOOL Features (October, 2010)" _________________ Regards
If the value at position one of your input is X'23', the value at position one of your output will be C'23' (ie, two bytes long).
If this does not work, post the full sysout from your attempt, in the Code tags, as it will mean your SORT is not up-to-date, so we will need to see what level of SORT you have to be able to suggest something else.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum