$$ Files and Rebuilding Files

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
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

$$ Files and Rebuilding Files

Post by jyoung »

Trying to find some information on $$ Files. In the Direct Importing Of Objects for PARM09 it states that
Control the use of $$ files.
Pass YES or NO or OPT.
Defaults to NO if not specified.
If NO, any existing $$ file will not be automatically deleted.
If YES, any $$ file of the files being imported will be automatically deleted. The file name to be deleted is composed of $$ plus the first 8 characters of the file name. Where 9 and 10 character file names are not unique in the first 8 characters, this may result in additional $$ files being deleted. (For the processing to complete, these files must be deleted.)
I "think" these files are created when the File gets rebuilt. But docs don't specifically mention it. http://docs.lansa.com/14/en/lansa015/in ... 3_0670.htm

This http://docs.lansa.com/14/en/lansa010/co ... _30018.htm talks about deleting the $$ File

But again, I am having trouble isolating when exactly the $$ File is built.

This http://docs.lansa.com/14/en/lansa095/co ... 1_0515.htm has a clue as it states
Delete $$ file is required when rebuilding a file, so that LANSA can rename the existing file beginning $$ and map data from the old file to the new.
however that is within the IDE. What about on the iSeries?

So it seems like the $$File is created when the File is rebuilt.
So when does a File get rebuilt? Does it only happen in the IDE? What about when you deploy a File or in my case export/import it?
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: $$ Files and Rebuilding Files

Post by MarkDale »

In the case of export import, on an iSeries.

On the iSeries, during import, if the data in the target environment is to be preserved:

Say you are importing a file like PSLMST, and there is already a PSLMST in the target environment

Lansa renames the existing physical file to $$PSLMST.

Then it brings in the new physical file and logical files to the target environment (the iSeries compiled objects - it does not rebuild them)

It then copies the data (CPYF *MAP *DROP) from the $$PSLMST into the new PSLMST Physical file.

It does things this way because the file structure may have changed and it wants to preserve the data in the preexisting fields.

If there was a $$PSLMST left over from an earlier import, then that would cause a problem when the import tries to rename PSLMST, but there is an option when running an import to automatically delete any pre-existing $$ files, so that the rename will proceed ok.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: $$ Files and Rebuilding Files

Post by jyoung »

Ok, so to make sure I am following along... :D
Say you are importing a file like PSLMST, and there is already a PSLMST in the target environment
If I am importing PSLMST, that means I have made a change to PSLMST, for example I added a Field.

LANSA will then, rename the File to $$File, create the new File and delete the $$File.

That makes sense as I have changed the structure of the data.

What if I don't modify the structure of the data? What if I just change the description? Will LANSA still recreate the File?

Lastly, LANSA only does this to Files that LANSA "owns". If a File was loaded into LANSA via the "Load Other File", LANSA never touches (renames, creates, deletes etc) the File, it only uses the definition to execute DML commands.

Is my understanding correct?

Thanks,
Joe
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: $$ Files and Rebuilding Files

Post by MarkDale »

For files lansa owns, it always does the $$ copy, if the data is to be preserved.

Its not rebuilding them - its copying the physical file object and loading in the data from the target environment.

For Other files I think the Physical file stays put, so you are just exporting lansa's definition of it, and the IO module, and there is no need to copy data.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: $$ Files and Rebuilding Files

Post by atostaine »

If everything goes perfect while recreating a file or export/import, LANSA deletes the $$file on it's own.

If it remains out there, and someone tries to recreate the file, LANSA lets you know because there is a possibility the $$ file is the only file that has your data.

Occasionally we will see them out there and we delete them. We also tell Mimix to ignore those.

Art
Art Tostaine
Post Reply