In this section: How to: |
The location of procedure (FOCEXEC) files, Master Files (MASTER), Access Files (ACCESS), and FOCUS database files may be QSYS, IFS, or both. IFS is the preferred location, and is the location used for files created by the HTTP Web Console.
IFS access follows the standards of a number of other platforms for FILEDEF, USE, and APPS, but is most like UNIX because the file names follow the same rules. The following is a summary of the respective commands and conventions
FILEDEF ddname DISK filename [(options] USE filename [AS name] END APP MAP MYAPP directory
where:
Is the reference name for the file being opened.
Is either the relative path or full path and the file name (for example, myfile.dat, acctng/myfile.dat, or /home/iadmin/acctng/myfile.dat).
Are the available access options, such as LRECL or RECFM.
For more information about FILEDEF options, see the Stored Procedures Reference.
Is the optional alternate name of the Master File.
Is the full path name of the directory (for example, /home/iadmin/acctng).
Use of a relative path name is not recommended, since this varies with any given connection to the server. Use of environment variables or shortcuts (for example, $HOME or ~) is not supported in any context.
How to: |
QSYS access works with libraries and has the following APP, FILEDEF, DATASET, and USE support for accessing existing applications.
The option to use IFS references to QSYS libraries is a native feature of IBM i. IFS references to QSYS names, such MYLIB, use IFS-style references, such as /QSYS.LIB/MYLIB.LIB, which are clearly recognizable as QSYS references.
To map a QSYS library to a WebFOCUS application root directory (APPROOT), use the APP MAP command, as described in How to Map a QSYS Library to APPROOT.
To access or create a FOCUS database in a QSYS library, you need to issue a USE command, as described in How to Use the USE Command to Access a FOCUS Database.
To access a member of a physical file (other than a FOCUS database) in a QSYS library, you can use either:
Using the DATASET attribute has the advantage of automatically specifying the correct member when you refer to the synonym.
If you issue an explicit FILEDEF command, and a DATASET attribute exists, the FILEDEF command takes precedence.
Creating a HOLD file automatically creates the physical file if it does not already exist. Issuing a -WRITE or -READ statement, however, requires that the physical file exist.
To assist with existing applications outside the pre-defined application root directory (APPROOT), the APP MAP command allows an alias to be assigned to a non-APPROOT directory. This alias becomes a virtual directory under APPROOT so it can then be referenced in an APP PATH command. Mapping does not automatically add to the path. It simply makes it available to participate in an APP PATH command. For more information about APPROOT, see the WebFOCUS Developing Reporting Applications manual.
In APP mode, the APP MAP command supports use of IFS QSYS library references so that the application name can be used for path search purposes in applications through the APP PATH command. However, the contents of a QSYS mapping are not available from the Web Console.
The syntax for mapping an application to a QSYS library is:
APP MAP appname /QSYS.LB/libname.LIB
where:
Is the name of the application.
Is the name of the library to which you are mapping the application. The name must be uppercase.
To use the FILEDEF command to access a member of a physical file in a QSYS library, the syntax is
FILEDEF ddname DISK library/file(member) (LRECL n
where:
Is the logical name you want to assign to the member. It can be up to eight characters in length, and can contain letters, numbers, and underscores. It must begin with a letter.
When used to associate a data source with a Master File, the ddname must match the name of the Master File.
Is the QSYS library in which the file is located.
Is the name of the file.
Is the name of the member to which you are assigning a logical name.
For the member of a single-member physical file, the member name must be identical to the file name. The operating system shorthand of *FIRST is not a valid alternative.
For a member of a multiple-member physical file, you can specify any member name.
Specifies the logical record length (LRECL) of the member.
Is the local record length.
To use the DATASET attribute of a Master File synonym to access a member of a physical file in a QSYS library, the syntax is
DATASET = library/file(member) (LRECL n
where:
Is the QSYS library in which the physical file is located.
Is the name of the physical file.
Is the name of the member that you want to access.
Specifies the logical record length (LRECL) of the member.
Is the local record length.
To access a FOCUS database, the syntax is
USE library/file[(member)] [AS name] [NEW] END
where:
Is the QSYS library in which the physical file is located.
Is the name of the physical file.
Is the name of the member that you want to access. If you omit the name, it defaults to the name of the physical file.
This is the default name used by WebFOCUS to refer to the member. You can override it by specifying AS name.
Defines a logical name that you can use instead of the member name.
Is the logical name you want to assign to the member.
Creates the member, and also creates the physical file if it does not exist. The data source is created as a member of a physical file starting with "F$". The file is created in the specified QSYS library.
This construction allows you to organize multiple FOCUS databases within a single QSYS physical file with a functional name, such as FOCUS, ACCTG, SHIPPING, AR, or AP; or as individual QSYS physical file members, such as SHIP(SHIP), AR(AR), AP(AP), or SHIP(FOCUS).
Early releases of FOCUS and iWay (FOCUS Release 6.x, and iWay Releases 3.x and 4.x) created FOCUS databases with an arbitrary "F$" added to the beginning of the source physical name and used "FOCUS" as the member name. Therefore, the name on the disk was in the form CURLIB/F$MYDB(FOCUS). All subsequent releases do not assume this is a default, and therefore require either a USE command with an explicit AS, or that the files are renamed to fit the current conventions.
For more information about the USE command, see the WebFOCUS Developing Reporting Applications manual.
iWay Software |