Using 10 character filenames
| Date: | Archived |
|---|---|
| Product/Release: | LANSA for the AS/400 |
| Abstract: | The permanent file override facility gives the ability to use files that are not standard LANSA file names. |
| Submitted By: | LANSA Technical Support |
It is now possible to use files with a name that is not a standard LANSA file name. To achieve this, the permanent file override facility is available. The principle is very simple:
- The actual name of the file and the name used by LANSA are defined in a source physical file on the AS/400.
- Via the permanent file override facility, the LANSA applications can detect and use the actual file names (for example, names which are used in your existing RPG environment).
LANSA Client* and LANSA Open can also make use of this facility for file names which are not standard LANSA names.
Activating and maintaining the permanent file override facility:
Activating
The permanent file override facility is very simple to activate.
In the LANSA system there is a version dependency data area called DC@OSVEROP (refer to the LANSA Technical Guide Volume 2 - Appendix A for more information about this data area). By adding the text *PERMFILOVR' to this data area (the position is not important as long as none of the existing options are overwritten) the facility is activated.
A source physical file called PERMFILOVR is created on the AS/400:
CRTSRCPF PERMFILOVR
This source file can be created in any library as long as it is present in the library list at run time.
LANSA checks for the existence of this file, and, when it is present, extracts the details from the first member for all file override details. If the override information is partition dependant, a version of this source file should be installed in the data library of each partition.
Maintaining
The PERMFILOVR file can be easily maintained via the AS/400 SEU editor and can contain both file override details and comment lines.
The character ";" (semi-colon) in the first position of a line indicates a comment line. Any other character in the first position of the line is considered to be a file override definition.
When any file override details are defined, all LANSA applications are passed the message "each time that I try to use this file, in reality I want to use the other file". This can be very useful, for example,when using files with names longer than 8 characters or which have a name containing a special character such as .'(period).
The file override details are defined as follows:
From File To File To Library
1234567890 1234567890 1234567890
Ensure that there is a space between each field!!
Example:
CUSTMAST CUSTMASTER MYLIBRARY
Example with comment lines:
;From File To File To Library
;234567890 1234567890 1234567890
CUSTMAST CUSTMASTER MYLIBRARY
Override details for two files can appear on one line...
From File To File To Library From File To File To Library
1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
Example with comments:
;From File To File To Library From File To File To Library
;234567890 1234567890 1234567890 1234567890 1234567890 1234567890
ITEMMAST ITEMMASTER DATALIB ORDERH ORDER.HEAD DATALIB
It is also possible to define one file per line followed by comments. Use the character ";" (semi-colon) where normally the second From' file name would be defined.
;From File To
File To Library Comment
;234567890 1234567890
1234567890 ;
ITEMMAST ITEMMASTER DATALIB ; Item master file
CUSTMAST CUSTMASTER MYLIBRARY ; Customer Master
If the library name is to remain unchanged, it does not have to be defined. The special values *LIBL or *CURLIB can also be used.
;From File To File To Library Comment;
234567890 1234567890 1234567890 ;
ITEMMAST ITEMMASTER ; Item master file
CUSTMAST CUSTMASTER *CURLIB ; Customer Master
ORDERH ORDER.HEAD DATALIB ; Order Header
ORDERD ORDER.DET *LIBL ; Order Detail
If any application makes use of Logical files, these logicals as well as the physical must be defined in the source file. LANSA executes the overrides only if this is necessary.
;From File To File To Library Comment
;234567890 1234567890 1234567890 1
ITEMMAST ITEMMASTER *LIBL ; Item master file
ITEMMAL1 ITEMMASTL1 *LIBL ; Item master by Item
ITEMMAL2 ITEMMASTL2 *LIBL ; Item master by Class
ITEMMAL3 ITEMMASTL3 *LIBL ; Item master by Category
ITEMMAL4 ITEMMASTL4 *LIBL ; Item master by Status
Remarks and warnings
- A maximum number of 500 file overrides can be defined. When more than 500 are defined, all extra overrides are ignored.
- LANSA does not check the overrides defined. Run time errors will occur if the file overrides are not entered at the correct position in the source file (From File, To File, etc.) or if the file defined is not found.
- The first I/O module loaded calls program M@PEROVR to load the details from file PERMFILOVR into memory. Since this file is only read once, to make any modifications effective exit from LANSA and use the RCLRSC command on the AS/400 or SIGNOFF and start again. This also applies when using LANSA Client or LANSA Open. All active sessions should be ended and restarted if the changes are required.
- For better memory (PAG) management, start program M@PEROVR before starting LANSA.This
will cause M@PEROVR to be loaded earlier in the PAG potentially reducing memory. To do
this, call the program as follows:CALL M@PEROVR X'00'
The value Hex 0 means that M@PEROVR should be loaded into memory and remain active.When using LANSA Open or LANSA Client add this call into the source of program LCXP9000. LCXP9000 is a user defined program which is called before LANSA Open or LANSA Client are started. It is useful, for example, for setting the library list on the AS/400. If LCXP9000 does not exist, LANSA Open or LANSA Client are started up in the normal way.
Example:
Action necessary to be able to use a file, FILE10NAME, and its logicals with a name that is 10 characters long:
- Create a special library for dummy files. This library shall only be used for file
definitions (without data). In this example we use the name DUMMYLIB as the library name.
- Use the AS/400 command CRTDUPOBJ to copy file FILE10NAME to DUMMYLIB. Also copy any
necessary logical files defined for the file (FILE10NAM1 and FILE10NAM2). Only the
definition is required, the data from these files will never be used.
- Use the AS/400 command DSPDBR to check that the logical files FILE10NAM1 and FILE10NAM2
have been successfully copied to DUMMYLIB and that they are indices for file FILE10NAME in
DUMMYLIB. This information is required when loading the file in LANSA.
- Give the file FILE10NAME and its corresponding logicals in DUMMYLIB a valid LANSA name
so that they can be loaded in LANSA.
In this example:
FILE10NAME is renamed FILE10NA
FILE10NAM1 is renamed FILE10N1
FILE10NAM2 is renamed FILE10N2
Copy all related files before they are renamed. If the physical file is renamed before the logical files are copied, the logicals will remain attached to the original file when they are copied to DUMMYLIB.
- The files can now be loaded/recognised by LANSA. Create the file FILE10NA in LANSA as a
maintained by OTHER' file and load the external definition (usually option
29=Load Other), then make the file operational so as to create the I/O module. Ensure that
the text "*PERMFILOVR" has been added to the LANSA data area DC@OSVEROP before
making the file operational.
- Create/change source file PERMFILOVR. The following lines should be defined:
FILE10NA FILE10NAME *LIBLThis presumes that the library that FILE10NAME and its logicals are in will be in *LIBL.
FILE10N1 FILE10NAM1 *LIBL
FILE10N2 FILE10NAM2 *LIBL
Once the files have been made operational, they are ready for use within LANSA. In the LANSA applications, the file names defined in LANSA are used but, at run time, the overrides defined in file PERMFILOVR in the library list (*LIBL) will be correctly implemented by LANSA.
For more details on the implementation of permanent file overrides see the member PERMFILOVR in DC@F28.