File Access on the iSeries
File access on the iSeries occurs via a Uniface Server (USERVER) of type ANY or FIL.
In client assignment files, you can redirect files, such as UARs, HTML or JavaScript files, text files, and so on, to a Uniface Server of type ANY or to FIL on the iSeries.
For text files such as HTML or JavaScript files, it is recommended that you store such files in the IFS, because file members in libraries have a fixed maximum record length and IFS files do not. When storing such files in file members in the library system, you run the risk of writing lines of text longer than the record length of the file, causing the line to be broken into two lines, which could cause errors when the member is used later on.
CCSIDs
Uniface can read text files and members in any CCSID as long as the CCSID attribute of the text file or member is set correctly, because the system performs on-the-fly conversion from the file CCSID to the CCSID of the Uniface job. However, when transferring files from a non-iSeries system to the iSeries, the CCSID of such files is often not correct because the tool used to transfer the file usually does not know about CCSIDs. If it is not corrected, Uniface reads the text using the erroneous CCSID and produces garbled text instead of the intended text.
The CCSID of text files in the IFS can be corrected using EDTF. If you open the file with EDTF and you see weird characters, then the CCSID is incorrect. Press F15 and modify the CCSID in field 3. For ASCII text change the CCSID to 850
, for UTF-8 text to 1208
, and for UTF-16 text to 1200
.
If the CCSID of the text file or member and the CCSID of the Uniface job are not the same, there may be characters in the text file or member that do not exist in the job CCSID. Such characters will be replaced by a substitution character and are lost to Uniface.
When Uniface writes to files or to file members it uses $SYS_CHARSET, which should be the same as the job CCSID. The only exception to this is when you use filedump with a codepage parameter, in which case the file will be written in that CCSID.
Specifying Paths
When specifying paths in ProcScript, the command line, or in assignment files, by default these paths refer to the library system. The form of such a path is library/member.file
. Uniface treats a file name extension as the physical file name, and the name itself as a member in that file. This way, files with the same extension end up as members in the same physical file. To access files or directories in the IFS you must prefix your path with IFS:
or !
.
However, if you use the /dir flag on the Uniface command line and specify an IFS path, such as /dir=IFS:/my/path
, then the default changes to IFS. Paths without prefix are now interpreted as IFS paths. To access a member in a file in a library, you must then use the prefix QSYS:
.
Uniface jobs have a current library and a current IFS directory, one of which you can change with the /dir
flag. For Uniface Servers the current library will be the same as that of the Uniface Router, which by default is the Uniface installation library. This can be altered in the STARTUP
CL program. The current directory is usually the home directory of the user profile that owns the Server process. For Uniface batch programs the current library and IFS directory are the ones of the job that submitted or spawned the job.
Note: Uniface is multi-threaded, so only IFS file systems that are thread-safe are supported by Uniface. Accessing files on non-threadsafe file systems might cause unpredictable errors and is not supported. (The ‘/’ root file system and /QopenSys are thread-safe.)