Results 1 to 3 of 3

Thread: [RESOLVED] [2005] A small translation (cant put a more precise title,ill explain)

  1. #1

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Resolved [RESOLVED] [2005] A small translation (cant put a more precise title,ill explain)

    Hello everyone...
    I have a problem here..ill explain...

    I have a column in my database which contains data about mainframe's datatypes.. like this...
    pix x
    pix xx
    pix x(5)
    pic 9
    pic 9(4)


    Thats how the data exists in the column.
    Now I need to retrieve that data and convert them and store them into 2 columns in another database like this....This is the translated form of the example shown above...
    DATA TYPE COLUMN . DATA LENGTH COLUMN
    Alpha numeric . 1
    Alpha numeric . 2
    Alpha numeric . 5
    Numeric . 1
    Numeric . 1

    Im trying to make my program to do this...Can you all give me your ideas?
    My idea is to check with many if statements? well,sounds long code...anything else I can do?
    Any ideas? help..Thanks
    Thanks
    Godwin

    Help someone else with what someone helped you!

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: [2005] A small translation (cant put a more precise title,ill explain)

    To me it looks like you really only need to check the digits after the space.
    Loop through each row of the column, place it into a string
    Split the string on the space.
    If the first item in the string array is pix the data type is Alph/Num
    if second string contains ( the legngth is what is between ()
    else the length is the length of the second string.
    Else if the first item is pic data type is Num and length is 1

    I think this would work. There may be a better way to do it, but I don't know it. This also assumes your example is an accurate representation of the actual data. So that is not many if statements at all.
    Visual Studio Team Edition 2005
    GDI+ Links: Bob Powell VB.Net Heaven
    API Links: All API Pinvoke.Net
    VB6 to VB.Net: Visual Basic 6 to .NET Function Equivalents (Thread)

  3. #3

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Re: [2005] A small translation (cant put a more precise title,ill explain)

    Thanks Bud
    Godwin

    Help someone else with what someone helped you!

Posting Permissions

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



Click Here to Expand Forum to Full Width