[MUSIC] Let's continue look at IO functions and we'll move on to look at the Charin function. Here we see the syntax of Charin. The first argument is the name of the input stream. The second argument is the starting point where Charin will begin to read data. This value may be a one for persistent stream, nor the value is supported. Do not specify a starting position for transient stream as the next character is always the transient stream starting point. The third argument, is the number of characters the function is to read. Specifying a length value of zero means that no data will be read. Specifying a start value of one and a length of zero together means that the read position is set to the beginning of the stream and no characters will be read. The value returned by Charin will either be the character string read from the input stream or a null value. Here are several examples of the Charin function that may be used in [inaudible]. The first example reads 10 characters from beginning of the input stream, my dot file, which is a non fully-qualified dataset name, these 10 characters are the value returned, and that's our assigned earth value of the variable in data. Now, here's the syntax of the Charout function. The first argument is the name of the output stream. The second argument is the string to write to the output stream. The third argument specifies the starting point where Charin will begin to write data. Misspelling may be one for a persistent stream. For a persistent stream like a dataset, the length of the string, to be written is limited to a maximum of 32,000 characters or 32,760 characters, to be completely precise. For transient streams like terminal output, the length of the string is limited by the capabilities of the device being written, which is typically 80 characters. Specifying a null string together with a start value of one, means that the right position is set to the beginning of the stream and no characters will be written. The return value from Charout will be zero if the right was successful or one if the string cannot be written to the output stream. Here are some examples of using the Charout function. The first example writes the string hello world to the non fully-qualified dataset out dot file, the value zero will be returned. The Char's function is pretty simple, it tests the input stream for the availability of more characters. If one or more characters remain available in the input stream, Char's returns a value of one. If the input stream is exhausted and there's nothing left, zero is returned. This could mean that the dataset on member is empty, the last character has been read, or an end of file has been encountered. The Char's function will always return a value of one when testing the default input stream. The one and zero value is returned by Char's can be used as true and false values in a conditional expression. Next, the Linein function. The first argument to Linein is the name of the input stream. Second argument is the line number, not character position, where the Linein function will begin reading. Only specify this argument for persistent streams, not for transient streams. The third argument, is the number of lines of data, not characters. Again, to be read, we're talking about lines here. This value may only be zero or one. A value of zero means that no data will be read and a non-string will be returned. Specifying a counter zero means the position pointer will be set at the beginning of a specified line at the input stream and no data will be read. Linein will return either the line of data that was read or a null string. Here are some examples of that. In the first example, the Linein function reads the next line from the input non fully-qualified dataset in dot file. The line of data is returned and assigned to the variable data. Next up, Lineout the first argument's the name of the output stream. Second argument is the string of data to write to the open stream. The third argument is present for compatibility reasons, but may only be a null value or one, does not allow you to set a appoint position to a specific line. The function will write by default, starting at the current right position. If the string to be written is longer than the logical record of the dataset being written, the line will be truncated and a value of one is returned by Lineout. Lineout will return a zero if the line is written successfully. You'll return a one if the line could not be written to the output stream or if the line is only partially written. Some examples of that. In the first example, Lineout writes the string "Hello world" to the output stream represented by the variable my file. If this is dataset with fixed length records, the line will be patted on the right with blanks to reach the logical record length, a value of zero will be returned. The lines function like Char's function tests, they named input stream for remaining lines of data. If one or more lines or partial lines remain in the input stream, lines returns a value of one. If the input stream is exhausted, a value of zero is returned. This means that the dataset or member is empty. The last line of data has been read or an EOF condition has been triggered. The values returned by lines one or zero may be used as the result of a conditional expression as shown in the example. The REXX stream function controls the processing of IO streams, file streams, and process streams, and obtains their status. A number of commands that are used within the stream function to control stream processing. The REXX input functions are Charin and Linein. The Chars on lines functions determine that the data remains in an input stream. The REXX helper functions are Charout and Lineout. Use submit to submit a job to the primary subsystem, JES running the job ID of the submitted job. The example on the screen reads the file into the stem, sets the number of lines, and submits the job. Finally, the snerkly named BPXWDYN is a text interface to a subset of the SVC 99 dynamic allocation and SVC 109 dynamic output services. BPXWDYN supports dataset allocation on allocations concatenation, the retrieval of certain allocation information, and the output and deletion of output descriptors. BPXWDYN is designed to be called from REXX and also worked with several other programming languages including assembler, CPL1. We've covered a lot of functions here. The net is that REXX has a ton of great functionality for reading and writing datasets. [MUSIC]