In COBOL is it possible to work with EBCDIC values?
that means if i want to write a program which will convert a file content from uppercase to lower case,i can do it in C by changin the corresponding ASCII values,is there something like that in COBOL?
or suppose i want to print the EBCDIC value of a character are these things possible in COBOL?
You can do it but it's not easy and/or it's not pretty.
First thing you might check is the Enterprise COBOL intrinsic functions and callable services.
Or you can try stuff like this to go from upper to lower case:
Move the byte to a COMP halfwd (low-ord byte). Add 64 and it's now upper case.
As for printing the HEX value of a field, I've used the code below. The redefines are a bit overdone because I had other uses for the fields. But it should give you an idea of what you can do.
100-CONVERT-HEX-DATA.
*--------------------------------------------------
* CONVERTS HEX DATA FOR DISPLAY PURPOSES
* E.G. X'04FB' => X'F0F4C6C2' OR 04FB CHARACTER
*--------------------------------------------------
MOVE WS-WORK-PACKED TO WS-WORK-UNPACKED
INSPECT WS-WORK-UNPACKED CONVERTING
X'FAFBFCFDFEFF' TO 'ABCDEF'
DISPLAY WS-WORK-UNPACKED-8
.