LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Reading Date in Fixed Format File

    Employee
    Posted 06-26-2012 19:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: mary

    I have a date in the format DD.MM.CCYY in a fixed format file that I would like to read in as a date using the Fixed Format File node.

    I have tried the obvious - EFF_DT,12,10,date("DD.MM.CCYY") but I get an error saying "Unsupported type specification: 'date("DD.MM.CCYY")'"

    If I just use date without the format, then the error is "Not in right date format: CCYY-MM-DD"

    Does this mean that the fixed format file node will only read in a date if the source file has it in the format, CCYY-MM-DD, or is there a way to define the date format?


  • 2.  RE: Reading Date in Fixed Format File

    Employee
    Posted 06-26-2012 22:01

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    What are the 12 and 10 for?

    try this:
    valid=date(EFF_DT,"DD.MM.CCYY")


  • 3.  RE: Reading Date in Fixed Format File

    Employee
    Posted 06-27-2012 03:21

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Stony,
    While this will work fine in a filter, it won't work correctly in the "FieldPositions" parameter in the Fixed Format File node.

    I believe that if you attempt to use a type other than string, that type must be in a format such that the data can be directly set into the BRD format.
    Therefore ,a date format of DD.MM.CCYY won't work.

    What you will need to do, is set the field definition in the FieldPositions parameter to:
    EFF_DT,12,10
    Then, in a subsequent filter node, you can do something like:

    effDt = date('EFF_DT',"DD.MM.CCYY")
    emit *
    override emit effDt as "EFF_DT"