|

Several sample programs are provided with the Record Framework as models for possible applications. These samples are provided "as is." Although they have been run on an OS/390 system, there is no guarantee that these samples will work without modification on your system.
This section contains information with which you need to be familiar before using these sample programs.
Where to find the Java source code for Record Framework sample programs
You can download the Record Framework sample program source code to your work station as an EBCDIC tar file. Then use the File Transfer Protocol (FTP) to transfer it in binary to your current work directory on OS/390.
- If the file name has changed during the download, rename it to recsamp.tar.z.
- Untar the file on OS/390 with the following command:
tar -xvzof recsamp.tar.z
Installing the Record Framework sample program source code creates the following directories in your current work directory:
- com/ibm/record/examples/
- com/ibm/record/examples/variableLength/
Javadoc for the Record Framework sample programs
Javadoc for the Record Framework API is available but, not for the sample programs.
Setting the environment to run the sample programs
To run the Record Framework sample programs on the IBM Developer Kit for OS/390, Java™ 2 Technology Edition, update CLASSPATH to include the Record Framework sample classes by using the following Shell command:
export CLASSPATH=$CLASSPATH:
/usr/lpp/java/IBM/J1.3/demo/jrio/recsamp.jar/:
/usr/lpp/java/IBM/J1.3/demo/jrio/recjava.jar/
To run the Record Framework sample programs on the IBM SDK for z/OS, Java® 2 Technology Edition, update CLASSPATH to include the Record Framework sample classes by using the following Shell command:
export CLASSPATH=$CLASSPATH:
/usr/lpp/java/J1.4/demo/jrio/recsamp.jar/:
/usr/lpp/java/J1.4/demo/jrio/recjava.jar/
The export command references the default path (/usr/lpp/java/IBM/J1.3) into which the IBM Developer Kit for OS/390, Java™ 2 Technology Edition was installed or the default path (/usr/lpp/java/J1.4) into which the IBM SDK for z/OS, Java 2 Technology Edition was installed. If the default path has been changed, change the export command accordingly.
Sample programs in com\ibm\record\examples
The following sections list and describe the source code listings for the sample recsamp.jar files in com\ibm\record\examples.
ColumnMajorArrayTest.java
This sample program demonstrates the use of an array that stores its elements in column major format.
InitTest.java
This sample program demonstrates the use of field initialization on an array field and an overlay field.
NDimArrayColumnTest.java
This sample program demonstrates the use of a multidimensional array that stores its elements in column major format.
NDimArrayTest.java
This sample program demonstrates the use of a multidimensional array that stores its elements in row major format.
OneDimArrayColumnTest.java
This sample program demonstrates the use of a one-dimensional array that stores its elements in column major format.
OneDimArrayTest.java
This sample program demonstrates the use of a one-dimensional array that stores its elements in column major format.
OverlayTest.java
This sample program demonstrates the use of an overlay or union data type in a record.
PackTest.java
This sample program demonstrates the effects of different packing hints on a record.
PersonTestApp.java
This sample program uses com.ibm.record to simulate an employee record.
RowMajorArrayTest.java
This sample program demonstrates the use of an array that stores its elements in row major format.
Sample programs in com\ibm\record\examples\variableLength
The following sections list and describe the source code listings for the sample recsamp.jar files in com\ibm\record\examples\variableLength:
DelimRecTest.java
This sample program demonstrates the use of a variable-length record that uses a character delimiter to separate the fields in the record.
DelimSubRecTest.java
This sample program demonstrates the use of a variable-length record that uses a character delimiter to separate the fields in the record. The record contains a delimited sub record.
LengthPrefixTest.java
This sample program demonstrates the use of a variable-length record that uses a 4-byte integer before the data to separate the fields in the record.
|