Alpha Video Training
Results 1 to 5 of 5

Thread: Help asked on ASCII import

  1. #1
    Banned
    Join Date
    Aug 2003
    Posts
    1,416

    Default Help asked on ASCII import

    Hi Guys,

    I am trying to import an ASCII file.
    All goes well except for two points that I can't solve.

    The date:
    My import file states the date like this: 20031005 which stands for 05 October 2003. When I select 'date' in the import genie for that field it ends up empty after importing. I assume the date format is unknown ?
    How can I adjust the format or what do I do to make it work ?

    The amount:
    My import file states the amount like this: 20050 which stands for $ 200.50 When I use 2 decimals on importing I get this result 200.00 Somehow the cents get lost.
    What do I do wrong here ?
    When I enter no decimals the result is: 20050.

    Can someone help my on my way with this ?

    Regards,

    Marcel

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default RE: Help asked on ASCII import



    Marcel Onck wrote:
    -------------------------------
    Hi Guys,

    I am trying to import an ASCII file.
    All goes well except for two points that I can't solve.


    The date:
    My import file states the date like this: 20031005 which stands for 05 October 2003. When I select 'date' in the import genie for that field it ends up empty after importing. I assume the date format is unknown ?
    How can I adjust the format or what do I do to make it work ?

    This is one of the times that it pays off to import into a temporary table and then append to the table that you desire. You can do a simple import - only character fields and numeric - and then change the data as you append. For your date field, then you can use ctod().

    The amount:
    My import file states the amount like this: 20050 which stands for $ 200.50 When I use 2 decimals on importing I get this result 200.00 Somehow the cents get lost.
    What do I do wrong here ?
    When I enter no decimals the result is: 20050.

    For the amount field you can import without decimals - since there aren't any - and then divide by 100 in the append to get the correct value.

    You want the import to describe the data as it actually exists at the time of the import. Then you want to change it to the characteristics of the target table.


    Can someone help my on my way with this ?
    Thank you for writing in English. My neighbor (from Holland) has limited time availability (and computer knowledge) to translate the Dutch. :-)

    alb


    Regards,

    Marcel

  3. #3
    Banned
    Join Date
    Aug 2003
    Posts
    1,416

    Default RE: Help asked on ASCII import

    Thank you Al !

    Some of your tips look obvious, but you do got to think about them. I guess the best solutions are always the obvious ones........

    Regards,

    Marcel

  4. #4
    Member
    Real Name
    Fred Daniel
    Join Date
    Jun 2000
    Location
    Birmingham, Alabama
    Posts
    302

    Default RE: Help asked on ASCII import

    Let me know how the temp table worked. I have the same exact problem pulling in dates like 20031115 from our main frame. The CTOD function dose not convert the date to 11/15/2003 for me. Alpha should add this date type since there are a lot of systems using this.

  5. #5
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Help asked on ASCII import

    From the interactive window

    date1 = "20031205"
    ?odbc_dt_to_d(transform(date1,"@r 9999-99-99"))
    = {12/05/2003}

    Alpha has functions to do what you want

    Jerry

Similar Threads

  1. Ascii File import
    By Mike Sabo in forum Alpha Five Version 5
    Replies: 3
    Last Post: 09-10-2004, 08:23 PM
  2. How to import specific ASCII file
    By mronck in forum Alpha Five Version 5
    Replies: 12
    Last Post: 08-26-2004, 01:47 PM
  3. Import ASCII files
    By geoff m in forum Alpha Five Version 5
    Replies: 2
    Last Post: 07-14-2003, 07:25 AM
  4. Import ASCII File Bug?
    By ChrisHawkes in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-30-2002, 10:35 AM
  5. import tab ascii delimted
    By abe kravetz in forum Alpha Five Version 4
    Replies: 6
    Last Post: 10-13-2001, 10:07 AM

Bookmarks

Posting Permissions

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