STREAMX as a Second Language by Scott DeChant, MEDSTAT Systems Presented at 1993 INTEREX Conference, San Francisco, CA, USA (Paper No: 5039) Introduction Popeye the Sailor used to say "I y'am what I y'am and that's all what I'am." STREAMX, VESOFT's interactive, intelligent batch job creation facility, tends to say the same thing (albeit much more grammatically). Why should this be the case? There's no reason that a system shouldn't be stretched to its limits (whatever those may be), and that newer features and capabilities shouldn't be found and shared. . . . Basic Programming Techniques Variable Prompting and Assignment. Variable prompting and assignment of values is at the heart of STREAMX as a programming language. STREAMX has variable space limits, depending on the number and types of variables used as well as the HP machine running STREAMX (consult the published STREAMX information for details). However, variable use can be powerful. . . . STREAMX Variable Usage. Now that our STREAMX variables have values, how can we use these variables in our jobs? 1. Prompt time input validation . . . 2. Conditional logic . . . 3. Value substitution . . . 4. Use with functions . . . Intermediate Programming Techniques Looping and Multiple File Usage. Another feature you can take advantage of is the ability to use a variable as an index for another variable. Strictly speaking, STREAMX does not support arrays, but arrays can be "fudged" by appending the "array index" to the end of the variable name (i.e., instead of using VAR(1), VAR(2), we use VAR1, VAR2 as the variable names). . . . Object-Oriented Design Applicability. Just as with other structured programming languages, STREAMX can lend itself to object oriented design. This is not object-oriented implementation (a la C++, Smalltalk, etc.), but is a modular design that allows reuse of code and global modification to code, reducing maintenance effort. . . . Program Prompt ::USE Files. When creating generic programs or jobs, modular code is typically easier to use and maintain. One way to achieve additional modularity is to place all program prompts in an external ::USE file that is called by the main job. . . . Menu-driven Programs. Menu-driven programs can reduce the need for multiple programs or for extensive customization in programs. Generic code reduces maintenance and simplifies code management. . . . Combining STREAMX and HP Command Files. Sometimes you may want to use a certain logic interactively; other times you may want to use the same functionality in a batch-mode job. By combining HP command files and STREAMX, you can do both without duplicating code. The process involves writing a HP command file with all the parameters needed, then creating a STREAMX file that prompts for the appropriate parameter information and calls the command file. . . . Advanced Programming Techniques Self-documenting Job Streams. . . . Post-execution Reporting. . . . Program-control Documentation. . . . Creating Accurate Test Environments. . . . KSAM file, VPLUS file access. . . . Conclusion STREAMX can be a valuable tool in job creation and execution, as well as serve as a secondary programming language. Few tasks are beyond the capabilities, although STREAMX may not be the best tool in all cases. As with any set of tools, you must find the right tool for the job, and use it to its full potential. STREAMX is also a great "structured language" for non-programmers, who can use programming concepts without all the overhead of a structured language. Non-programmers in our shop have been able to write their own STREAMX programs, saving the programming department extra work, and giving user the tool of their own. . . .