How do I get the inbound file name in a tcl

Clovertech Forums Cloverleaf How do I get the inbound file name in a tcl

  • Creator
    Topic
  • #119605
    Gene Millard
    Participant

      I have a new process where files with different names will be placed in the same directory.

      Each file will be processed differently.

      How can I get the Inbound file name from the metadata?

      Gene Millard

      • This topic was modified 2 years, 9 months ago by Gene Millard.

      The Guthrie Clinic
      Sayre, PA

    Viewing 6 reply threads
    • Author
      Replies
      • #119607
        Keith McLeod
        Participant

          Protocol Driver Control holds this value.  You can see it in SMATDB using metdata tab.  It will depend where you need to grab the filename from.  If from a tclproc, then you would use msgmetaget command.  If from inside an xlate xpmmetaget.

           

          I believe msgmetaget $<your filehandle> DRIVERCTL

          In an Xlate, xpmmetaget $xlateId DRIVERCTL

          Should help getting you the info….

           

        • #119608
          Gene Millard
          Participant

            I got it to work.

            Thank you

            The Guthrie Clinic
            Sayre, PA

          • #119609
            Jim Kosloskey
            Participant

              IBFILE I believe is the key for the IB Filename within the DRIVERCTL Keyed List.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #119610
              Gene Millard
              Participant

                I am able to get the entire path with

                set driverCtl [msgmetaget $mh DRIVERCTL]
                set ibFileName [keylget driverCtl FILENAME]

                 

                but I cannot get just the inbound file name with

                set ibFileName [keylget driverCtl IBFILE]

                [sms :sms :ERR /0:toAtaArchiveAfterProcess:03/10/2022 12:00:59] Tcl error:
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] msgId = message0
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] proc = ‘tpsSetFromOracleFileName’
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] args = ”
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] result = ‘key “IBFILE” not found in keyed list’
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] errorInfo: ‘
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] key “IBFILE” not found in keyed list
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] while executing
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] “keylget driverCtl IBFILE”
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] (procedure “tpsSetFromOracleFileName” line 17)
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] invoked from within
                [sms :sms :ERR /0:toAtaArchiveAfterProcess:–/–/—- –:–:–] “tpsSetFromOracleFileName {MSGID message0} {CONTEXT sms_ob_data} {ARGS {}} {MODE run} {VERSION 3.0}”‘

                The Guthrie Clinic
                Sayre, PA

              • #119611
                Boris Perov
                Participant

                  We just use “file tail”

                  set driverCtl [msgmetaget $mh DRIVERCTL]
                  set ibFileName [keylget driverCtl FILENAME]
                  set filename [file tail $ibFileName]

                  • This reply was modified 2 years, 9 months ago by Boris Perov.
                • #119613
                  Jim Kosloskey
                  Participant

                    Ah my mistake. FILENAME is the Key not IBFILE.

                    Thanks Boris.

                    email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                  • #119614
                    Gene Millard
                    Participant

                      The file tail code worked.

                      Thank you

                      The Guthrie Clinic
                      Sayre, PA

                  Viewing 6 reply threads
                  • You must be logged in to reply to this topic.