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,
HOW TO EXTRACT TWO DATA IMBEDDED IN ONE BYTE
Moderators: Frank Yaeger, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Code: Select all
INREC BUILD=(1,1,TRAN=HEX)
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
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.
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.
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page