Page 1 of 1

Importing IBM i Duplicate Fields

Posted: Sat Feb 16, 2019 3:31 am
by jyoung
This is my first experience with this type of situation and I would like to know more about how this works and if I am being setup for some issues.

We have a File on the IBM i that I previously imported that contains a Field named RPU that is a Decimal(15).
I just imported another File that has a Field named RPU that is a Signed(7,6).

Because of the type conflict LANSA created a RPU001 Field for the newly imported File.

On my local SQL Server Database, LANSA created the table with the RPU001 column and I reference the RPU001 Field in code.

My question is:
How does LANSA know that on my local database that the column is RPU001 but on the IBM the field is RPU? Or does it? Do I have to deal with this discrepancy manually?


Re: Importing IBM i Duplicate Fields

Posted: Sat Feb 16, 2019 5:01 am
by lawingo
Hey Joe,

In your code you will have to reference the "RPU001" field when referring to that file. When you update the file on the ibm it will update the "RPU" field correctly even though the field name is "RPU001". Since the file is an "OTHER" file, Lansa simply maps the field to the other field based on field attributes.

I run into this all the time on our system. It's a pain but thats the way it works.

For instance we have a file (OELROLT) that has a field named "INVNUM". I'ts been named over twice.

Code: Select all

Select Fields(*ALL) From_File(OELROLT) Where(#INVNUM002 = ' ') Io_Error(*NEXT) Val_Error(*NEXT)
When I select or update from (OELROLT) i have to used the "INVNUM002" and Lansa maps that field definition to the file that it refers to. If I use anything else then the code bombs.

I hope this helps

Sherrill Furntiure Company

Re: Importing IBM i Duplicate Fields

Posted: Sat Feb 16, 2019 7:25 am
by jyoung
Hey Chad,
Good to know. I was concerned I was going to have to something odd, because I could not find any indication of how the field RPU001 gets mapped back to RPU on the iSeries. I guess this is something that LANSA just knows and not something we see.

Thanks for the help.

Re: Importing IBM i Duplicate Fields

Posted: Tue Feb 19, 2019 7:52 am
by atostaine
Yeah it just works. You have to remember to use the 001 field. I wish we could name the field instead of 001 being added automatically. I would prefer a prefix based on the file name instead of an 001.