Changing a physical file

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
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Changing a physical file

Post by Kingston »

If I change a Physical file on the Iseries that I already have brought into LANSA, can I refresh the definition of that in LANSA or do I need to delete the current version in LANSA and bring it in from scratch?
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Changing a physical file

Post by jyoung »

You should be able to reload it. I think LANSA will update it's definition and update your local table with the new structure.
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

Is there a separate reload option, or is it the same process as bringing it in as a new file?
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

I decided to try doing it via the usual way of adding a new file and the fields with new lengths created new fields in LANSA with 001 appended to the end of them.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Changing a physical file

Post by jyoung »

It's the same as loading an existing File.
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

It's completely screwed now. The original fields are now divorced from the file so even deleting the file won't get rid of them and I have to find each field and delete them separately. Basically, reloading the file when it already exists will cause it not to replace the fields that are already there but create new ones with 001 appended to the end and divorce the original fields from the file in the IDE.

Best practice would seem to be to delete the original file from the Repository first and then re-load it
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Changing a physical file

Post by jyoung »

Really!? I've reloaded a File multiple times and never had a problem, although I don't recall adjusting lengths.
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

Yeah I suspect because the fields I didn't change all came across ok that it's only if you change the definition of a field that already exists in LANSA that it has a problem. Under those circumstances it brings the new field in with a modified name and leaves the old field alone (but seemingly no longer Cross Referenced to that file)
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

Anyway, the old file and fields are all deleted now and the new version brought back in and all is working ok.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: Changing a physical file

Post by atostaine »

Re-loading "other" files you have to click new. That's weird.

You've seen If you change fields in the file and reload, Lansa will create new names. That stinks. Whenever you reload an other file with column changes delete all the fields first.

Art
Art Tostaine
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Changing a physical file

Post by jyoung »

Glad you got it worked out.

Yeah, "reloading" by way of "new" is weird an not at all intuitive.

Always creating new Fields for the File does stink, I would think it should allow you to specify if you want to replace or create new Fields when it finds conflict like that.
Kingston
Posts: 51
Joined: Tue Aug 08, 2017 5:25 pm

Re: Changing a physical file

Post by Kingston »

Yes the option to "replace fields" makes perfect sense (and should probably be the default)

I can't think of a reason why you would want to bring the file back in and NOT automatically replace all the fields. Unless you had already changed the properties of the fields within the IDE and you wanted LANSA to keep those changed properties and not override them. That is probably what the designers had in mind.
Post Reply