1

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") 
Mirza Sisic
  • 2,401
  • 4
  • 24
  • 38
dna
  • 483
  • 3
  • 10
  • 32
  • You don't have a decimal. A decimal is a "packed decimal", and X'30' is not a packed decimal. I can't say how you get 26 out of it other than GIGO. – Bill Woodger Aug 25 '16 at 22:43
  • so the team who sends us the data apparently told us that the value should be read as Hex. Although I suppose might be some function which could fix this GIGO – dna Aug 26 '16 at 15:07
  • If X'30' arrives and you want to know that it is hexadecimal 30, you can't treat it as "decimal" (packed-decimal) to do that. Effectively it is a one-byte binary or one-byte integer. – Bill Woodger Aug 26 '16 at 17:17
  • Agreed. so would it be ok to treat it as binary or integer by any chance? – dna Aug 26 '16 at 19:02
  • We don't know if it's OK to treat it as binary since we don't know how the value is meant to be interpreted: it could be a binary value, it could be a character in some obscure codepage, it could even be some sort of "overpacked" decimal that is missing its zone-halfbyte. Only the creator of the data can tell you how to interpret it. – piet.t Aug 29 '16 at 06:10

0 Answers0