EBCDIC to ASCII before writing to SMAT file

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf EBCDIC to ASCII before writing to SMAT file

  • Creator
    Topic
  • #48323
    Michael Lacriola
    Participant

      I got some data coming from an AS/400 that just so happens to be the EBCDIC character set. When I open SMAT, I can see what I received if I modify the encode scheme to EBCDIC from the default value of “ASCII no encoding performed.”

      Viewing the SMAT data in ASCII provides unwanted results (not to mention extremely hard to read). I would like to perfom a msgmapdata on the incoming string (ibm_e2a) before it writes to SMAT so I do not have to worry about always changing the encode scheme. Can this be acomplished? I can convert to ASCII when I’m doing the reply generation  of the inbound message so I won’t have to convert to all downstream ASCII servers. The inbound message is handled by a pdl that is similar to the mlp_tcp.pdl and is working as designed (stripping start and endblocks correctly).

    Viewing 2 reply threads
    • Author
      Replies
      • #58331
        Troy Morton
        Participant

          Did you ever find a way to do this?  We would also like to keep our SMAT files in ASCII format even if the inbound/outbound data is in EBCDIC.

        • #58332
          Russ Ross
          Participant

            A round about way to do this if determined, which it sounds like you are determined, is to create 2 processes like such:

            process 1:

            inbound EBCIDIC thread that static raw routes to a

            hop send ASCII thread that writes to SMAT and sends to local host via TCP/IP

            process 2:

            hop receive TCP/IP thread listening on locahost that xlates/routes to

            outbound thread to foreign system

            Attahced is a visual screen shot to help visualize the concept.

            EBCDIC has been a bit of a pain to work with but I’ve just been using our ebcdic_smat_to_nl.ksh script to convert our EBCDIC smat files to ASCII new line terminated files that are then useable.

            If this approach is of interest, check out the following 3 scripts that will convert any smat file to newline even if messages aren’t HL7

               ebcdic_smat_to_nl.ksh

               len10_to_nl.pl

               ascii_smat_to_nl.ksh

            that I previously posted at the following URL

            <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=1539&&#8221; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1539&amp;

            Russ Ross
            RussRoss318@gmail.com

          • #58333
            Troy Morton
            Participant

              Thanks Russ!  This is great stuff!  I didn’t realize you could convert files using HCISMAT from the command line.  I’ll have to play with that more.

              The EBCDIC to ASCII script will be very useful!

              Troy

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.