DT_BYTES not able to convert Packed decimal in right format

Alkari, Niranjan 0 Reputation points
2024-06-18T07:26:12.0633333+00:00

I get weird result when I convert the ASCII file containing the packed decimal received from upstream system.

The data is in form 0x00 0x00 0x00 0x00  0x00 0x97 0xB4 0x62  0x19 0x0A which dosen't seem to me correct ZONED format. Can someone please advise?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,523 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 35,546 Reputation points
    2024-06-19T06:30:20.0733333+00:00

    Hi @Alkari, Niranjan,

    When it imports a host data declaration, Transaction Integrator (TI) converts Zoned Decimal (COBOL numeric PIC with DISPLAY or no USAGE, or RPG S data type) or Packed Decimal data types to Decimal or Currency Automation data types, respectively. Depending on the development application you are using, there might not be an equivalent for Decimal or Currency data types. If this is the case, use one of the following techniques to ensure that the data type works correctly with TI:

    Use language-supplied functions to manipulate the Automation types for Decimal or Currency.

    • Within TI Project, if the data type has a fractional component, modify the method's parameter from the Decimal or Currency data type to the Floating Point Binary data type (double or single precision as appropriate). You can substitute a 16-bit or 32-bit binary Integer data type if the data declaration has no fractional component and the number of data declaration digits fits within the expected range.

    Zoned Decimal or Packed Decimal Data Types

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Alkari, Niranjan 0 Reputation points
    2024-06-19T13:23:58.9766667+00:00

    @ZoeHui-MSFT I forgot to mention .. this issue is during SSIS process. Do you have any idea on this?

    File we receive is in ASCII format with packed decimal inside. We read it as fixed width or Ragged right mode and code page with ASCII.