Conver the HEX values

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
deepu2pani
Member
Posts: 6
Joined: Mon Sep 25, 2006 11:50 am

Conver the HEX values

Post by deepu2pani » Fri Mar 10, 2017 1:46 am

Hi,

the Hex value of ! is X'5A'
the Hex value of @ is X'7C'
the Hex value of # is X'7B'

INPUT FILE (File length is 2 bytes)
5A
7C
7B


My requirement is to read the Input file and check the HEX decimal value of the 2 byte field and write the value in to output file

OUTPUT FILE (File length is 1 bytes)
!
@
#


So please guide me how to achieve this.

I dont know weather i explained my requirement properly

Thanks,
Deepu.[/quote]

deepu2pani
Member
Posts: 6
Joined: Mon Sep 25, 2006 11:50 am

Post by deepu2pani » Fri Mar 10, 2017 8:45 pm

I finally found the answer, We can do it with Sort

OPTION COPY
INREC BUILD=(1,2,TRAN=UNHEX)

shrikant
Member
Posts: 1
Joined: Fri Aug 11, 2017 12:59 pm

Post by shrikant » Fri Aug 11, 2017 1:22 pm

:roll:

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