HOW TO EXTRACT TWO DATA IMBEDDED IN ONE BYTE

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Isa
Member
Posts: 7
Joined: Thu Aug 19, 2010 3:58 pm

HOW TO EXTRACT TWO DATA IMBEDDED IN ONE BYTE

Post by Isa » Sat Mar 08, 2014 12:05 am

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'
3C6512 --|

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'
23C6512 --|

Regards,

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Sat Mar 08, 2014 6:12 am

Code: Select all

 INREC BUILD=&#40;1,1,TRAN=HEX&#41;

Isa
Member
Posts: 7
Joined: Thu Aug 19, 2010 3:58 pm

Post by Isa » Sun Mar 09, 2014 3:39 am

Hi William,
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.

Regards,

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Mar 09, 2014 9:31 am

Suggest you try what was provided.

If there are still questions, post what happened and your question. . .
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun Mar 09, 2014 5:23 pm

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
Nic

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Sun Mar 09, 2014 7:14 pm

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.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others