Porting AS400 LANSA files to windows

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jabdefiant
Posts: 16
Joined: Fri May 31, 2019 1:07 pm

Porting AS400 LANSA files to windows

Post by jabdefiant »

Hi All,

I am porting a LANSA Application to windows from AS400, and having some issues with the files.

We did a LANSA export on the AS400. Then inside the windows IDE, I was able to pull in the objects with the IMPORT functionality on the IDE toolbar.

The files were compiled and created in MSSQL server successfully. However, when I try to insert into the files, I get a Duplicate key error.
While debugging the issue, I tried duplicating a file inside of LANSA, and the new file allows me to insert without any problems. When I look at the tables inside of MSSQL, they look the same (except the name), even though they behave differently.

I need my code to be able to interact with the imported files...does anybody have any ideas/direction?

Thanks in advance
Andy
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Porting AS400 LANSA files to windows

Post by Dino »

Hi Andy

While I think this would be more a case for support as files from the IBM are used in Windows without problem as tables all the time, assuming you don't have data that creates those duplicates, does the files have keys? one, or many? you said you created another version of that file and it works. what is the difference?

If you go in Windows to SQL Management Studio, you can use the right button of the mouse on the table, select Script Table As, Create to, New Query Editor Window and that will create an sql snippet that shows how the file is created:
script01.png
script01.png (76.21 KiB) Viewed 7087 times
Do it for both versions, compare, find the difference, then you can look for the reason.
script02.png
script02.png (106.54 KiB) Viewed 7087 times
jabdefiant
Posts: 16
Joined: Fri May 31, 2019 1:07 pm

Re: Porting AS400 LANSA files to windows

Post by jabdefiant »

Hi Dino,

Thank you so much for your response. Being able to see the SQL Create script gave me enough info to determine what was going on.

The RRNO was my issue.....when I imported from AS400, the IDENTITY parameter was turned off (which caused me issues),but when I created the file in windows, this parameter was on, and it worked fine. It's because the AS400 handles the RRNO automatically, and does not need the OAM to do the additional step of incrementing a counter.

I went into the file maintenance in the IDE, and to the attributes tab, and found a parameter for that feature.

tldr; I turned on a "Auto RRNO generation" feature on the files (in windows), and recompiled all my files...and everything started working.

Thank you again for your assistance.
Andy
Post Reply