Slide 41 of 80
Notes:
- The main entry point is detected by the absence of all parameters or by the lack of the entry= keyword.
- The first parameter extracted is the name of the file to be streamed.
- The remaining parameters are captured in the variable _str_parms, after the command line has been upshifted and all blanks have been removed.
- If the ;JOBQ= keywords is found in the command line the queue name is extracted. You might wonder why the second word (instead of the default of 1), and why at a position that indexes the = rather than the character immediately right of the =? Using word(_str_parms,,,,_str_pos+6) works in all cases, including a null (empty) jobq value. However, it fails when ;jobq= with no value is the last token on the command line. It fails in this case since the index (_str_pos+6) is beyond the end of the _str_parms string length. Extracting the second word starting at the = works in all cases.
- If jobq= is not present in the command line, the STREAM UDC invokes itself (highlighted in blue) using an alternate entry point, with $STDIN redirected to the file being streamed. This method allows the stream file to be read efficiently by the UDC.