ASCII to EBCDIC

Hello All,
How can I convert ASCII to EBCDIC using PI? Any modules to be used in channel?
Thanks,
Regards,
Naresh

Hi,
Please check below thread.. it mentions about the beans you can use.
Convert EBCDIC to ASCII and ASCII to EBCDIC in PI7.0 SP14
Regards,
Deepak

Similar Messages

  • Converting ASCII to EBCDIC and Packed Decimals as well

    Hi All,
    We have a requirement where data from a SAP system comes in ASCII format as  a flat file.PI needs to encode 4 fields in the packed decimals and rest of the fields in EBCDIC format before sending to mainframe system.
    When I use code page cp500 at the reciever file adapter level it encodes the entire file in EBCDIC format.
    However we want those 4 fields to be in packed decimals while sending to mainframe system.
    Could you please help me in figuring out a solution?
    Thanks,
    Sowmya

    Hi Sowmya
    Check this thread
    ASCII to EBCDIC packed decimal

  • ASCII to EBCDIC converter

    Hello everybody!
    I'm looking for a function module which converts ASCII text to EBCDIC. Unfortunately I couldn't find anything about this so far. It would be great if somebody could give me some information about.
    Thankyou!
    Best regards,
    Markus

    Hi Marcus,
    You don't need a Function Module; there is a ready ABAP command 'EBCDIC(x)' available.
    You will find more information here: [Converting ASCII to EBCDIC and vice-versa|http://www.sapdb.org/7.4/htmhelp/5e/0a41edba9d11d2a97100a0c9449261/frameset.htm]
    Also, check this link : [Standard include for converting ASCII / EBCDIC|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/converting-data-from-ascii-to-ebcdic-in-unicode-environment-420663]
    Hope this helps! Please let me know if you need anything else!!
    Cheers,
    Shailesh.

  • Re: Code convert ascii to EBCDIC

    At 09:06 PM 8/13/97 +0900, Isao Yamada wrote:
    I am trying conversion ascii-to-EBCDIC conversion.You didn't mention the platform, but if it is Unix, I would just pipe the
    input through the dd command. Even if this is a Win32 platform, I would
    consider buying the Win95 toolkit from Ready-to-Run and using the dd
    command in it.
    =========================================================================
    Thomas Mercer Hursh, Ph.D email: [email protected]
    Computing Integrity, Inc. sales: 510-233-9329
    550 Casey Drive - Cypress Point support: 510-233-9327
    Point Richmond, CA 94801-3751 fax: 510-233-6950

    Isao,
    You can convert arbitrary binary data
    using MemoryStream, ReadBinary(), pointers
    and casting to convert simple binary types to the
    type you require. Here is a partial code fragment
    from some binary communications code we wrote
    to give you the idea. Although it looks like
    'C' in places it really is valid TOOL code.
    buf : MemoryStream = new;
    theHeader : MemoryStream = new;
    theData : MemoryStream = new ;
    tempData : BinaryData = new ;
    countBytes : integer = 0 ;
    tempcountBytes : integer = 0 ;
    ConnId : ui2 = 0 ;
    magicNumber : ui4 = 0x5aa50ff0 ;
    p : pointer = nil;
    buf.Open(accessMode = SP_AM_READ_WRITE);
    theHeader.Open(accessMode = SP_AM_READ_WRITE);
    // Read the header
    theHeader.Flush() ;
    theHeader.Seek( position = SP_RP_START ) ;
    countBytes = 0 ;
    // Parse theHeader here
    theHeader.Seek( position = SP_RP_START ) ;
    theHeader.ReadBinary( target = tempData, length = 4 ) ;
    p = (pointer)(tempData.Value) ;
    PacketLength = *(pointer to ui4)(p) ;
    theHeader.ReadBinary( target = tempData, length = 1 ) ;
    p = (pointer)(tempData.Value) ;
    PacketType = *(pointer to ui1)(p) ;
    theHeader.ReadBinary( target = tempData, length = 2 ) ;
    p = (pointer)(tempData.Value) ;
    PacketSeqNo = *(pointer to ui2)(p) ;
    theHeader.ReadBinary( target = tempData, length = 2 ) ;
    p = (pointer)(tempData.Value) ;
    ConnId = *(pointer to ui2)(p) ;
    theHeader.ReadBinary( target = tempData, length = 4 ) ;
    p = (pointer)(tempData.Value) ;
    magicNumber = *(pointer to ui4)(p) ;
    if( magicNumber != 0x5aa50ff0 ) then
    buf.Close() ;
    theHeader.Close() ;
    return FALSE ;
    end if ;
    [email protected]
    MIME-Version: 1.0
    Content-type: text/plain; charset=iso-2022-jp
    Hi! Everyday I read some useful tips from this mailing-list.
    I am trying conversion ascii-to-EBCDIC conversion.
    I want to read binary-file, because EBCDIC code data come by floppy-disk.
    But I can't read this file into TextData object.
    (TextData Class have method to access by byte.)
    I know that I can read binary-data into BinaryData object.
    if I can access BinaryData class by byte or read binarydata into textdata.
    Does anyone have good idea for this question?
    thanks.
    T.C.F.Co.Ltd.
    Isao Yamada([email protected])
    Any views expressed in this message are those of the individual sender,
    except where the sender specifically states them to be the views of
    Reuters Ltd.

  • Convert EBCDIC to ASCII and ASCII to EBCDIC in PI7.0 SP14

    Wea re going to be implementing PI7.0 SP14.
    I am writing the technical specification for an inbound/outbound interface into/out of ECC 6.0!
    I need to convert the File that is created out of SAP into EBCDIC in PI and for the inbound convert the file from EBCDIC into ASCII for import into ECC.
    I have more than one way to this...
    The ways I have found so far are:
    Use MessageTransformBean, use TextCodepageConversionBean, XmlAnonymizerBean, using the File Encoding field on the File/FTP Adapter, XSLT mapping or Java mapping!
    I have checked the OSS Note 821267, but this doesn't help.
    I am sure all these methods have pros and cons...
    What would be the most efficient method of changing this?  It will be running hourly and have upto 6000 entries an hour - each way!

    Hi Barry,
    I think the most efficient way in my thinking is XSLT and Java mapping.
    For java mapping u just need to get thye jar file.I believe that the encoding cp285 / cp500 is EBCIDIC. Try printing
    byte [] msg = .. // whatever
    System.out.println(new String(msg, "cp285"));
    if you get an exception saying Cp285 is unknown you may need an international version of the JRE, depends on the version you're using.
    Also u can use this in reverse.
    Please see this post:
    Re: Handling Packed decimals in XI
    regards
    Aashish Sinha
    Edited by: Aashish Sinha on Mar 25, 2008 6:07 PM

  • ASCII to EBCDIC Packed Decimal

    Hi all,
    I want to convert a 9-digit number which is in ASCII to a 5-digit EBCDIC packed decimal using OSB.
    Can anyone please help me with this?
    Thanks in advance!
    Regards,
    Karthik

    This can be done using MFL

  • Sorting in ASCII vs EBCDIC

    Hello,
    We are doing a codepage conversion from EBCDIC to ASCII and we have discovered that the sorting is not the same. In our EBCDIC environment letters are first and then numbers. In the ASCII-environment numbers are first and the letters.
    Is this correct? Is it possible to change the sorting so it is the same as in EBCDIC?
       Regards
       Ann-Sofie

    Hi JoeSchmoe115,
    In Reporting Services, we can add ORDER BY clause to presort data that is retrieved for a report in the dataset queries. Or we can sorting groups or sorting by aggregate values in the report. When we add ORDER BY clause to sort the data in the order we want
    it sorted in the report. Presorted data improves report processing time because of the way it is stored in memory. And there are many report processing tasks do not require sorting data before processing it. For example, SUM is not order-dependent and Data
    within group instances is not automatically sorted.
    So sorting groups or sorting by aggregate values is much simpler in the report than in the query and is frequently more efficient also. If we do not need sorted data in the report, do not set sort expressions on the dataset. For more details, please see:
    Troubleshooting Reports: Report Performance
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Re: Code convert ascii to EBCDIC-thanks

    thanks alfred.
    Your hints is enable to make convert-program.
    method CodeConvertB.SJISToEBCDIC(copy input InData: Framework.BinaryData,
    copy output OutData: Framework.BinaryData,
    copy input Length: integer = 0)
    begin
    memIn : MemoryStream = new;
    memOut : MemoryStream = new;
    tmpIn : BinaryData = new;
    tmpOut : BinaryData = new;
    OutData = new;
    j : ui1;
    ic : char;
    oc : char;
    if Length = 0 then
    Length = InData.ActualSize;
    elseif Length > InData.ActualSize then
    Length = InData.ActualSize;
    end if;
    memIn.Open( SP_AM_READ, TRUE );
    memIn.UseData( (pointer to char)(InData.Value), Length );
    memIn.Seek( SP_RP_START );
    memOut.Open( SP_AM_READ_WRITE, TRUE );
    memOut.Seek( SP_RP_START );
    for i in 0 to Length - 1 do
    memIn.ReadBinary( tmpIn, 1 );
    ic = *( pointer to char )( tmpIn.Value );
    j = ic;
    oc = ToEBCDIC[j];-- Value is EBCDIC.Array is S-JIS(ASCII) order
    tmpOut.SetValue( &oc, 1 );
    memOut.WriteBinary( tmpOut, 1 );
    end for;
    memIn.Close();
    memOut.Flush();
    memOut.Seek( SP_RP_START );
    memOut.ReadBinary( OutData, Length );
    memOut.Close();
    return;
    end method;
    if someone want to use this complete-code, mail to me.
    thanks.
    T.C.F.Co.Ltd.
    Isao Yamada([email protected])

    thanks alfred.
    Your hints is enable to make convert-program.
    method CodeConvertB.SJISToEBCDIC(copy input InData: Framework.BinaryData,
    copy output OutData: Framework.BinaryData,
    copy input Length: integer = 0)
    begin
    memIn : MemoryStream = new;
    memOut : MemoryStream = new;
    tmpIn : BinaryData = new;
    tmpOut : BinaryData = new;
    OutData = new;
    j : ui1;
    ic : char;
    oc : char;
    if Length = 0 then
    Length = InData.ActualSize;
    elseif Length > InData.ActualSize then
    Length = InData.ActualSize;
    end if;
    memIn.Open( SP_AM_READ, TRUE );
    memIn.UseData( (pointer to char)(InData.Value), Length );
    memIn.Seek( SP_RP_START );
    memOut.Open( SP_AM_READ_WRITE, TRUE );
    memOut.Seek( SP_RP_START );
    for i in 0 to Length - 1 do
    memIn.ReadBinary( tmpIn, 1 );
    ic = *( pointer to char )( tmpIn.Value );
    j = ic;
    oc = ToEBCDIC[j];-- Value is EBCDIC.Array is S-JIS(ASCII) order
    tmpOut.SetValue( &oc, 1 );
    memOut.WriteBinary( tmpOut, 1 );
    end for;
    memIn.Close();
    memOut.Flush();
    memOut.Seek( SP_RP_START );
    memOut.ReadBinary( OutData, Length );
    memOut.Close();
    return;
    end method;
    if someone want to use this complete-code, mail to me.
    thanks.
    T.C.F.Co.Ltd.
    Isao Yamada([email protected])

  • ASCII to EBCDIC conversion

    Hi there!
    I am working on an Oracle data extract project. My output file will send to a DB2 database and a mainframe application. In my file, some fields' type is COMP-3. I use Oracle build-in function convert () to convert to EBCDIC. This works fine in SQL*PLUS. But when I use it in my PL/SQL program, I got "ORA-06502: PL/SQL: numeric or value error: character to number conversion error". Here is my program.
    FUNCTION get_vd_pro_norm_mth_amt(p_account_rec IN ACCOUNT_ROW) return varchar2
    as
    v_scaled_amount               varchar2(15);
    BEGIN
         select convert(a.scaled_amount, 'WE8EBCDIC500','US7ASCII')
         into v_scaled_amount
         from pin61_02.rate_bal_impacts_t a, pin61_02.rate_plan_t b
         where b.poid_id0 = a.obj_id0 and
              b.account_obj_db = p_account_rec.poid_db and
              b.account_obj_id0 = p_account_rec.poid_id0 and
              b.account_obj_type = p_account_rec.poid_type and
              b.account_obj_rev = p_account_rec.poid_type;
         return v_scaled_amount;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN NULL;
    END get_vd_pro_norm_mth_amt;
    I guess the wrong data type of my variable v_scaled_amount generated the problem. I do not know which data type should I use to store EBCDIC data.
    Thanks a lot!
    Max

    try with nvarchar2.
    NVARCHAR2
    You use the NVARCHAR2 datatype to store variable-length Unicode character data. How the data is represented internally depends on the national character set specified when the database was created, which might use a variable-width encoding (UTF8) or a fixed-width encoding (AL16UTF16). Because this type can always accommodate multibyte characters, you can use it to hold any Unicode character data.
    The NVARCHAR2 datatype takes a required parameter that specifies a maximum size in characters. The syntax follows:
    NVARCHAR2(maximum_size)
    Because the physical limit is 32767 bytes, the maximum value you can specify for the length is 32767/2 in the AL16UTF16 encoding, and 32767/3 in the UTF8 encoding.
    You cannot use a symbolic constant or variable to specify the maximum size; you must use an integer literal.
    The maximum size always represents the number of characters, unlike VARCHAR2 which can be specified in either characters or bytes.
    my_string NVARCHAR2(200); -- maximum size is 200 characters
    The maximum width of a NVARCHAR2 database column is 4000 bytes. Therefore, you cannot insert NVARCHAR2 values longer than 4000 bytes into a NVARCHAR2 column.
    You can interchange VARCHAR2 and NVARCHAR2 values in statements and expressions. It is always safe to turn a VARCHAR2 value into an NVARCHAR2 value, but turning an NVARCHAR2 value into a VARCHAR2 value might cause data loss if the character set for the VARCHAR2 value cannot represent all the characters in the NVARCHAR2 value. Such data loss can result in characters that usually look like question marks (?).
    [email protected]
    Joel P�rez

  • ASCII-EBCDIC conversion

    Hello,
    I am looking for a tool which can convert from ASCII to EBCDIC (firstly) and
    from EBCDIC to ASCII.
    (I should store some columns in EBCDIC because some COBOL program should read it.)
    Regards,
    Laszlo

    Thank you !
    But how can i use the other character sets instead of the common ?
    May I load into the database ?
    For example:
    create table OIT015
    ENTSTAMP TIMESTAMP(6) not null,
    ORDNR NUMBER(11) not null,
    ORDERDATEN VARCHAR2(3800) not null
    tablespace PLINK_HBCI
    pctfree 10
    pctused 40
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    insert into OIT015 (ENTSTAMP, ORDNR, ORDERDATEN)
    values (to_timestamp('11-11-0011 11:11:11.000011', 'dd-mm-yyyy hh24:mi:ss.ff'), 2, 'X');
    update oit015 set orderdaten=convert('00000396375160','WE8EBCDIC500') where ordnr=2
    commit;
    My collegues wrote the same data with COBOL program into test table in EBCIDIC.
    There is the result:
    select dump(t.orderdaten,16), t.* from oit015 t
    0,0,3,96,37,51,60,c     11.11.11 11:11:11.000011     1111111111     
    f0,f0,f0,f0,f0,f3,f9,f6,f3,f7,f5,f1,f6,f0     11.11.11 11:11:11.000011     2     ?????óuöó÷onö?
    My collegues said that 'WE8EBCDIC500' is special display format on mainframe.

  • 'a' character with ASCII = EBCDIC back and forth conversion

    Hi,
    I'm trying the following code:
                   System.out.println(" --- Using Java --- ");
                   String v1 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                   System.out.println("ASCII: "+v1);
                   String ebcValue = new String(v1.getBytes("Cp1047"));
                   System.out.println("EBCDIC: "+ebcValue);
                   String v2 = new String(ebcValue.getBytes(), "Cp1047");
                   System.out.println("ASCII: "+v2);
    It outputs:
    --- Using Java ---
    ASCII: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
    EBCDIC: ?���������������������������������������������������
    ASCII: bcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
    The issue is that 'a' ASCII $61 is supposed to end up $81 in EBCDIC but shows up as $3F in EBCDIC, so when I convert back to ASCII I'm getting $1A instead of the original $61.
    I looked for a solution in the forums and googled it too. I did not find a solution so far.
    Any clue, someone?
    TIA!
    Domi

    Hi,
    I'm trying the following code:Strings in java hold unicode. They do not hold ascii nor ebcdic.
    Data inserted into a java string is mapped into unicode.
    new String(v1.getBytes("Cp1047"));You have a set of bytes (not ebcdic). Those bytes are interpreted based on the default encoding on your system and mapped into unicode.
    So the above line is completely meaningless and likely to produce garbage.
    >
    The issue is that 'a' ASCII $61 is supposed to end up
    $81 in EBCDIC but shows up as $3F in EBCDIC, so when
    I convert back to ASCII I'm getting $1A instead of
    the original $61.Demonstrate this using bytes only.
    If you can create demonstration that does not have the above encoding problem then you should submit it to the bug database.

  • How are you handling ASCII 0 values

    Hi,
    I have noticed a strange thing with ASCII 0 values. in the process of database replication MSSQL to Oracle some columns in the source DB (MSSQL) have some of the values as ascii 0.
    when i load this data with sqlldr in oracle and query the table this columns are not considered as null.
    ex:
    table_name : PriceItems
    Column_name : Description
    if i query the table with select count() from PriceItems where Description is null* the result is 0
    if i query the table with select count() from PriceItems where Description = chr(0)* the result is 301 (actual rows)
    how can we handle this kind of situations?
    is this a bug of Oracle?
    My Oracle Version:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    "CORE     11.1.0.7.0     Production"
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Edited by: user8999602 on Sep 3, 2012 9:22 AM

    Ascii character zero indicates a NULL character. Not a null string.
    A null string is a string without a value - i.e. a string that has no ASCII (or EBCDIC or Unicode) characters. Oracle does not discriminate between Ascii characters.
    Character zero is used, on Windows for example, as string terminator. An empty string can thus only contain a zero terminator. And thus the confusion. An empty string is not the same as a null string in this case - but a zero string length implies the string is empty, does not contain characters (despite containing a char zero), and is therefore null.
    The issue is inconsistencies in implementation and terminology. NULL itself is a very abused concept in software engineering.

  • JMS Correlation ID not converting to EBCDIC Hexa

    We are using the PI 7.1 system on a AIX platform.
    We use the JMS adapter to send messages to a MQ Queue manager on a AS400platform.
    WebSphereMQ transport protocol is in JMS adapter.
    We are generating custom dynamic correlation id using a UDF.
    Expectation is to receive the correlation id in Ebcdic format because the
    receiving end is a AS400 system.
    But what I receive there is a Ascii Hexa.
    For a example we are sending the correlation id as 0180000012. (ASCII)
    What MQ receive is 30313830303030303132 (ASCII HEX)
    Where what MQ should receive is F0F1F8F0F0F0F0F0F1F2 (EBCDIC HEX)
    I need help to find out why JMS adapter is converting the correlation id
    in to ASCII HEX without converting to EBCDIC HEX.
    Appreciate a lot if any one can provide some help on this.
    Thanks a lot,
    Tania.

    I am not sure if I have understand the issue correctly.
    Do you create an ASCII string and the ASCII characters are not converted into EBCDIC,
    or do you create a HEX String?
    Or does the JMS adapter converts your ASCII string to Hex?
    I have the impression that the behaviour is a design gap, which nobody has noticed before.
    A work around could be in converting the ASCII to EBCDIC inside the UDF,
    Report this to SAP

  • SFTP in ASCII

    Hi, I'm using TES 5.3.1 and I'm working on an FTP transmission to a bank.  They have asked that the file be sent SFTP in either ASCII or EBCDIC, but using the integrated FTP job, it only allows Binary when transferring SFTP.  Is there something I'm missing, or is ASCII SFTP not supported?
    Thanks,
    Scott

    ASCII transfer mode for SFTP was added in Tidal Enterprise Scheduler 6.x.
    John
    Cisco TAC

  • EBCDIC to ANSI Conversion

    Hi,
    We have a question from the partner and they want to know how the data from mainframe can be converted from EBCDIC to ANSI format?
    Any pointer would be helpful.
    Thanks
    Umesh

    Check out the DB2 z/OS Installation & Setup guide (...and, I think you mean ASCII and not ANSI...)
    If you use a typical GG capture process + data pump to send data to/from z/OS to/from unix/linux/windows, then GoldenGate v10+ should automatically convert between ASCII and EBCDIC when the pump sends the data to the remote trail. (It's been a while since I've tried.... But you can use logdump to verify if you have the environment to test with.) See the limitations in the aforementioned guide (e.g., multi-byte characters are not converted, unicode is not converted).
    Also, you may have to explicitly add in a conversion parameter if going to/from Nonstop... if you are, see the GG win/unix upgrade instructions for GG v11. It's just one parameter that I'm omitting here so as not to confuse the issue.
    Note also that if you're using logdump, there are specific ebcdic commands you can use to view trail data & trail header info on z/OS. Just type "help" in logdump on z/OS for all the options.
    If you're attempting to convert any of the unsupported data types -- then you'll probably have to do it in the database post-replication (e.g., Oracle DB has functions to do this), such as loading a staging table with the ebcdic data that is in turn processed and loads your ascii table. (There are probably a number of ways to accomplish this with varying degrees of complexity.)
    Cheers,
    -m

Maybe you are looking for

  • FX 5200 T-128 problem

    I recently bought a nVIDIA GeForce FX5200 T-128 card, which claims to support dual link DVI on the manual, but how is that remotely possible when there is only one physical connector on the card, which happens to be analogue??????????????? Please hel

  • How to Get the Previous Transactional Data into Special Purpose Ledger

    Hi, 1). We have implemented Special Purpose Ledger. After implementing SPL, we are generating documents and getting the postings into SPL. Now I need to bring the previous postings which were entered before Special Purpose Ledger Setup. Please Help m

  • Address book won't accept invitation

    When I get an invitation to a meeting here at work I get this message: Invitation Error To be able to use invitations, you need to create an address card for yourself in Mac OS X Address Book. I have an address card in my Address Book, but it won't r

  • Leaving color while making a photo grayscale

    I am working on a project and need to make my photos black and white while leaviing certain items of the photo in it's original color. I need to know if someone can help me out and give me some direction on this. An example of what I am trying to do

  • Roaming profile login problem to the domain

    Hi all, Domain Environment, DC Server with Server OS of Microsoft Server 2008 R2 Standart SP1. Roaming profiles unable to login to the domain on couple of PC's. They just inserting the password, starting to wait to log in with "Welcome" on the screen