6.1.3 Editing an iSeries stream file using a PC editor

If you exposed some or all of your iSeries IFS using a file share, then you can edit many configuration, log, and source files with a PC editor. Remember that not all stream files contain readable text. If you accidentally open one and it is not readable text, then be sure to exit without saving. If you save the file, you may corrupt it even though you did not make any deliberate changes.

You must use the editor with care. Ensure that it can read and write simple ASCII files. Word processors may not be suitable or may only be suitable with care.

Notepad (in the Windows Accessories folder) is suitable for some files, but not all files. Some iSeries files use the UNIX convention of a line feed between lines rather than the DOS convention of using a carriage return and line feed. Notepad does not understand these files and presents them in an incorrect way. An advantage of Notepad is that it can open a file that is in use but cannot save that file while it is in use.

Wordpad (another Windows accessory) may also suitable for some files. Wordpad can save in Word document format (be careful not to use this option). It copes with the UNIX style line feeds that some iSeries files use. However, it cannot open files that are in use.

The best option may be to use a PC editor that is intended for programmer use. There are may available. Whichever editor you use, you may find that some files that you expect to be text are unreadable. Be careful to exit these files without saving. If the file contains many @ symbols, then it is possible that it is a text file, but in EBCDIC. For more information, see the following section.

6.1.4 Stream files and CCSID

CCSIDs are labels for a file and some other objects. They indicate the code page of the data within them. When database or stream files are labelled with an appropriate CCSID, OS/400 performs any necessary conversion when the file is read or written by OS/400 programs.

If a stream file is created on the PC, for example, by creating a new text file in Windows Explorer, it is given an ASCII CCSID. Most OS/400 software can use this. That is, although the software may expect EBCDIC, the operating system can convert the data as required.

If the file is created by Java on the iSeries server, it also gets an ASCII CCSID so you should be able to read it on both the PC and the iSeries (if it is a text file). However, if the file is created on the iSeries by something other than Java, it may get an EBCDIC CCSID. This is usable by OS/400 software but not by PC software as mentioned in the previous section. You are likely to see many @ characters because the EBCIDC code for space is the same as the ASCII code for @. A situation in which this may occur is when a file is created using redirection from a Qshell command.

You can create an ASCII file in the Qshell on the iSeries server by using the touch command. This command can be useful in scripts. If the file is created with an ASCII CCSID, then data written to it by following iSeries software should be translated. The result should be readable from a PC.

It is possible to change the CCSID of a stream file after it is created without changing the data already in the file.

If it is easy to recreate the file, then the easiest approach may be to delete the file, create it again with an ASCII CCSID, and run the application again. You should now be able to view the file from a PC. To create the file with an ASCII CCSID, either create it from a PC using a mapped drive or by using the touch command.

142Geac System21 commerce.connect: Implementation on the iSeries Server

Page 154
Image 154
IBM SG24-6526-00 manual Editing an iSeries stream file using a PC editor, Stream files and Ccsid