reading hex value in datastage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
nimcurry
Participant
Posts: 7
Joined: Mon Nov 02, 2015 10:42 am
Location: toronto

reading hex value in datastage

Post 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")
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
sg33
Participant
Posts: 25
Joined: Wed Nov 24, 2010 3:07 am
Location: India

Post 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)
Best Regards
Post Reply