Page 1 of 1

reading hex value in datastage

Posted: Thu Aug 25, 2016 12:55 pm
by nimcurry
we have a mainframe file which we are trying to read using Complex Flat File Stage. The column has data type PIC X(1) which we are reading as char(1) and assigning to char (10). problem is it converts to value "26" when the value should be 30. The value displayed in mainframe is x'30' (which seems to be hex). Is there a way to convert value correctly in datastage? Right now following is being implemented in the transformer:
DecimalToString(seq(link1.DAY),"suppress_zero")

Posted: Thu Aug 25, 2016 1:57 pm
by FranklinE
You are "stuck" on the standard character set conversion. Because the Cobol definition is alphanumeric, DataStage is attempting to translate it to ASCII.

EBCDIC x30 is not listed on my chart. ASCII x26 is "&". Check the settings in CFF for the version of EBCDIC.

In the meantime, if you must preserve the value in the field, try making it binary instead, PIC 9(1) COMP. You will get the numeric value of x30 in the int() column it should be converted to.

Important: check the program that creates the output. This could be a mistake in the copybook for the file.

Posted: Mon Aug 29, 2016 9:14 am
by sg33
Thanks for your response Franklin.

I tried to read this attribute as Binary, but it threw an error in the very next attribute on the copy code. This attribute was being read ok with decimal values with the original copy code when the problematic column was read as PIC X(1).

This next column is defined as Decimal (11,2)