InterviewSolution
| 1. |
What If I Need To Have The Same Application Running On Multiple Platforms, Such As Unix And The Mainframe? Does That Mean I Have To Maintain Two Separate Sources? |
|
Answer» Not at all. REXX includes an instruction that allows you to determine the environment in which your PROGRAM is running. PARSE SOURCE will give you a string in which the first TOKEN is the NAME of the system where the program is running. For uni-REXX, this is "UNIX"; on the mainframe, it would be "CMS" or "TSO". Then you can put conditional processing into your program based on the current execution environment. In a program that needed to display a current listing of files, you might set your master source up something like this: parse source env: select when env = 'UNIX' then command = 'ls' when env = 'CMS' then command = 'listf' when env = 'TSO' then command = 'listc' otherwise call OS_error_routine end : : [ to do a list command, you write]> : command /* value is sent to OS */Not at all. Rexx includes an instruction that allows you to determine the environment in which your program is running. PARSE SOURCE will give you a string in which the first token is the name of the system where the program is running. For uni-REXX, this is "UNIX"; on the mainframe, it would be "CMS" or "TSO". Then you can put conditional processing into your program based on the current execution environment. In a program that needed to display a current listing of files, you might set your master source up something like this: parse source env: |
|