Date/time stamp in file name created by MIM in destination list

I'm trying to append a date/time stamp to the name of a file MIM is creating in a destination list but no substitution is taking place.  I'm using the ${gmtDate}${gmtTime} variable, but that literal is appended to the file name (if the file name is TESTFILE.TXT and I use want to append the name with the time stamp, I put  TESTFILE_${gmtDate}@${gmtTime}.TXT.....but the substitution doesn't happen in the destination list....but it does work in a request template, straight FTF).  How can I do this in a dlist?

Tagged:

Comments

  • Ethan Beisher
    Ethan Beisher E Community Moderator

    Mark,

     

    See this example for how you can use an exit to perform this functionality:

     

    /awd/forums/questions/3401732

  • Can't seem to find the replaceFileName  script in our registry or in our bin file.  mvh

  • Ethan Beisher
    Ethan Beisher E Community Moderator

    It is attached to the post in the referred-to article.


  • 594b5121-666a-7161-5347-5b4251665f5f
    cf005791-1a81-47af-b50e-f6bf1e272aaa

    Pre_Sender_Exit_Point
    -1
    0
    Exception
    '{' parenthesis expected in line 54

    {
    var temp=strPolicy;
    Date::new();
    temp=temp.gsub("\\${gmtDate}",Date.gmtDate);
    temp=temp.gsub("\\${gmtTime}",Date.gmtT

    Depends on exception thrown!

  • Ethan Beisher
    Ethan Beisher E Community Moderator

    Yes, there was a problem with my example. I have updated it, and reposted it to the original message.

  • Still no luck. Using the new replaceFileName script I receive the following error:

    activity Pre_Sender_Exit_Point
    locationCode Exception locationCode
    message 'strPolicy' undeclared identifier in line 31

    var temp=strPolicy;
    Date::new();
    temp=temp.gsub("\\${gmtDate}",Date.gmtDate);
    temp=temp.gsub("\\${gmtTime}",Date.gmtTime);

    Line 31 of the script appears as
    temp = temp.gsub("\\${SECOND}",rightJustify(Date.second,2.'0'));

    I see no error.

  • When I run the replaceFileName.xms script, I receive the same error:

     

    XMOException: XMScriptException

    'strPolicy' undeclared identifier in line 22

     

    doVariableSubstitution(strPolicy)

    {

     var temp=strPolicy;

     Date::new();

     temp=temp.gsub("\\${gmtDate}",Date.gmtDate);

     temp=temp

    Error Code:103

    (:21)

     

    VM terminated with rc = 2000

  • Ethan Beisher
    Ethan Beisher E Community Moderator

    Can you post your "Request XML" from the Process Monitor Request entry?

  • <?xml version="1.0" encoding="UTF-8"?>



    EIDTHDQ01WT_QM
    ZEIDQHDQ00W_QM
    trans_qa
    EIDTHDQ01WT_QM
    xmdir://EDI210_2WDTRANS_Q2F.XML
    /home/ra/cqcomm/in/EDI210_${gmtDate}_${gmtTime}.dat
    TEXT
    640
    TRUE
    5

    1
    1



    5
    replaceFileName
    replaceFileName
    EIDTHDQ01WT_QM

    Pre_Rec_Exit_Point


    mqsid

  • Ethan Beisher
    Ethan Beisher E Community Moderator

    Please run the following from a command line and post the results:

     

    xmoscrpt replaceFileName.xms -etestreplaceFileName -x

  • Microsoft Windows [Version 5.2.3790]
    (C) Copyright 1985-2003 Microsoft Corp.

    N:\>xmoscrpt replaceFileName.xms -etestreplaceFileName -x
                PM XMScript V 8.1.86.14
             Copyright  (c) 1997 - 2008 Metastorm, Inc., All Rights Reserved.
    Not Compiled
    XMOException:  XMScriptException
    'strPolicy' undeclared identifier in line 31

      var temp=strPolicy;
      Date::new();
      temp=temp.gsub("\${gmtDate}",Date.gmtDate);
      temp=temp.gsub("\${gmtTime}",Date.gmtTime);

    Error Code:103
    (:30)

    VM terminated with rc = 2000

    N:\>