Results 1 to 3 of 3

Thread: Reading Date in Fixed Format File

  1. #1

    Question Reading Date in Fixed Format File

    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. #2
    Lavastorm Employee stonysmith's Avatar
    Join Date
    Nov 2006
    Location
    Grapevine Tx
    Posts
    799

    Default

    What are the 12 and 10 for?

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

  3. #3
    Lavastorm Employee
    Join Date
    Aug 2009
    Location
    Cologne
    Posts
    513

    Default

    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:
    Code:
    EFF_DT,12,10
    Then, in a subsequent filter node, you can do something like:

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

Posting Permissions

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