Home

Results 1 to 4 of 4

Thread: Delimited Text Driver - convert string date to !CTIME

  1. #1
    morganginga NNTP User

    Delimited Text Driver - convert string date to !CTIME


    Hello all,
    I am trying to convert a string of numbers coming in through a Delimited
    Text Driver to a !CTIME to store in another variable inside a TIME
    syntax attribute. I saw in some previous posts on here that
    token-convert-time would likely be the best way to accomplish this.
    Here is the trace where I'm still not quite getting it to work and I'm
    wondering why. I stored the string in a local variable and then tried
    to use token-convert-time, but it seems like it lost the value in the
    middle of trying to perform the convert. Any help is greatly
    appreciated.

    -Morgan

    [02/12/15 16:05:16.658]:empref PT: Evaluating selection criteria for
    rule 'Format Termination Date'.
    [02/12/15 16:05:16.658]:empref PT: (if-op-attr
    'utcIrisTerminationDate' available) = TRUE.
    [02/12/15 16:05:16.658]:empref PT: Rule selected.
    [02/12/15 16:05:16.658]:empref PT: Applying rule 'Format Termination
    Date'.
    [02/12/15 16:05:16.658]:empref PT: Action:
    do-set-local-variable("lv-TerminationDateTimeConvert",scope="policy",token-op-attr("utcIrisTerminationDate")).
    [02/12/15 16:05:16.658]:empref PT:
    arg-string(token-op-attr("utcIrisTerminationDate"))
    [02/12/15 16:05:16.659]:empref PT:
    token-op-attr("utcIrisTerminationDate")
    [02/12/15 16:05:16.659]:empref PT: Token Value: "20150131".
    [02/12/15 16:05:16.659]:empref PT: Arg Value: "20150131".
    [02/12/15 16:05:16.659]:empref PT: Action:
    do-reformat-op-attr("$lv-TerminationDateTimeConvert$",token-convert-time(dest-format="!CTIME",dest-tz="EST",src-format="yyyyMMdd")).
    [02/12/15 16:05:16.659]:empref PT: Expanded variable reference
    '$lv-TerminationDateTimeConvert$' to '20150131'.
    [02/12/15 16:05:16.659]:empref PT: Action:
    do-set-dest-attr-value("$lv-TerminationDateTimeConvert$",token-convert-time(dest-format="!CTIME",dest-tz="UTC",src-format="yyyyMMdd")).
    [02/12/15 16:05:16.660]:empref PT: Expanded variable reference
    '$lv-TerminationDateTimeConvert$' to '20150131'.
    [02/12/15 16:05:16.660]:empref PT:
    arg-string(token-convert-time(dest-format="!CTIME",dest-tz="UTC",src-format="yyyyMMdd"))
    [02/12/15 16:05:16.660]:empref PT:
    token-convert-time(dest-format="!CTIME",dest-tz="UTC",src-format="yyyyMMdd")
    [02/12/15 16:05:16.660]:empref PT:
    token-convert-time(dest-format="!CTIME",dest-tz="UTC",src-format="yyyyMMdd")
    [02/12/15 16:05:16.660]:empref PT: Arg Value: "".
    [02/12/15 16:05:16.661]:empref PT:
    DirXML Log Event -------------------
    Driver: \DPATRIOT\utc\IDM\dPatriotDriverSet\Empref
    Channel: Publisher
    Status: Warning
    Message: Code(-8033) Error in
    vnd.nds.stream://DPATRIOT/utc/IDM/dPatriotDriverSet/Empref/Publisher/PubEventXform-FormatAttributes#XmlData:70:
    Couldn't convert date/time '': java.text.ParseException: Unparseable
    date: ""


    --
    morganginga
    ------------------------------------------------------------------------
    morganginga's Profile: https://forums.netiq.com/member.php?userid=6370
    View this thread: https://forums.netiq.com/showthread.php?t=52821


  2. #2
    tschloesser NNTP User

    Re: Delimited Text Driver - convert string date to !CTIME


    Hi,

    my guess here is that something is wrong with your reformat operational
    attribute action. Please enshure that you specyfy first the attribute
    you want to reformate (utcIrisTerminationDate). Within the argument
    builder make shure that you put a noun-token returning the original
    value as a child to the convert-time token.

    Take this code as an example:

    <policy>
    <rule>
    <description>Change Time Syntax</description>
    <conditions>
    <and>
    <if-op-attr name="utcIrisTerminationDate" op="available"/>
    </and>
    </conditions>
    <actions>
    <do-reformat-op-attr name="utcIrisTerminationDate">
    <arg-value type="string">
    <token-convert-time dest-format="!CTIME" dest-tz="UTC"
    src-format="yyyyMMdd">
    <token-local-variable name="current-value"/>
    </token-convert-time>
    </arg-value>
    </do-reformat-op-attr>
    </actions>
    </rule>
    </policy>

    Take care,
    Thorsten


    --
    tschloesser
    ------------------------------------------------------------------------
    tschloesser's Profile: https://forums.netiq.com/member.php?userid=3232
    View this thread: https://forums.netiq.com/showthread.php?t=52821


  3. #3
    ab NNTP User

    Re: Delimited Text Driver - convert string date to !CTIME

    Thank-you for the trace output; in the future it will likely help to show
    the trace going into the policy or rule as well as the trace of the rule
    processing. Also, please paste the actual policy
    (PubEventXform-FormatAttributes) being traced here.

    I believe the action is setup incorrectly; I see a local variable being
    set with a time value, but then it looks like that local variable is being
    used to specify which attribute, not which value, should later be
    reformatted and set (two separate actions, probably just for testing as
    they are redundant, and probably both wrong). Be sure to feed your
    convert-time token a value, and be sure that your set/reformat tokens are
    also fed a variable name, and not the value, where appropriate.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below...

  4. #4
    morganginga NNTP User

    Re: Delimited Text Driver - convert string date to !CTIME


    I changed the format of the utcIrisTerminationDate attribute to Time and
    tried your suggestion Thorsten. Your suggestion worked!! Thank you so
    much. :-)


    --
    morganginga
    ------------------------------------------------------------------------
    morganginga's Profile: https://forums.netiq.com/member.php?userid=6370
    View this thread: https://forums.netiq.com/showthread.php?t=52821


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •