command_file_parameters
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
command_file_parameters [2018/11/16 23:41] – WIP lricker | command_file_parameters [2018/11/20 17:37] – lricker | ||
---|---|---|---|
Line 142: | Line 142: | ||
==== But My Script Needs More Than 8 Parameters ==== | ==== But My Script Needs More Than 8 Parameters ==== | ||
- | Normally, eight parameters P1...P8 is sufficient for almost any script/ | + | Normally, eight parameters P1...P8 is sufficient for almost any script/ |
- | TODO -- | + | |
+ | - Create explicit DCL code (programming) to turn one or more " | ||
- | JOB_CTLFLAGS | + | (**Note to system administrators**: |
- | compound parameter | + | Here's an example of the second method, "compound parameter |
+ | < | ||
+ | $ ! COMPOUND_PARAMETERS.COM | ||
+ | $ ! | ||
+ | $ ! Assume that com-line parameters P1..P7 are allocated and used | ||
+ | $ ! for specific purposes in this script, but you need "a few more" | ||
+ | $ ! | ||
+ | $ ! Make P8 function as a compound parameter: | ||
+ | $ ! | ||
+ | $ ! ...Process parameters P1..P7 here... | ||
+ | $ ! | ||
+ | $ SEP = ";" | ||
+ | $ j = 0 ! initialize (" | ||
+ | $CPLOOP1: | ||
+ | $ arg' | ||
+ | $ IF ( arg' | ||
+ | $ ! ...else, got a good element/ | ||
+ | $ ! ...so edit that element: Upcase it, remove leading/ | ||
+ | $ arg' | ||
+ | $ j = j + 1 ! since it's a good one, count it | ||
+ | $ GOTO CPLOOP1 | ||
+ | $ ! | ||
+ | $CPCONTINUE1: | ||
+ | $ ! At this point, we've got from zero (0) to j+1 elements extracted from P8 | ||
+ | $ ! (j is our upper-limit)... | ||
+ | $ ! Process these compound values (here, demo'd by just echoing them out to display): | ||
+ | $ i = 0 ! another short& | ||
+ | $ WRITE sys$output "Echo P8 compound parameter values:" | ||
+ | $CPLOOP2: | ||
+ | $ ! When i > j, we're done... | ||
+ | $ IF ( i .GT. j ) THEN GOTO CPCONTINUE2 | ||
+ | $ ! ...nope, process the compound parameter (here, just display it): | ||
+ | $ tmp = arg' | ||
+ | $ WRITE sys$output " | ||
+ | $ ! ...or, this works too: $ WRITE sys$output " | ||
+ | $ i = i + 1 ! next counted-element... | ||
+ | $ GOTO CPLOOP2 | ||
+ | $ ! | ||
+ | $CPCONTINUE2: | ||
+ | $ ! ...script continues here | ||
+ | $ WRITE sys$output "" | ||
+ | $ WRITE sys$output " | ||
+ | $ WRITE sys$output "" | ||
+ | $Done: | ||
+ | $ EXIT 1 | ||
+ | </ | ||
+ | Then you could invoke (call) this script, //with more than 8 parameter values//, as follows: | ||
+ | |||
+ | < | ||
+ | $ @COMPOUND_PARAMETERS value1 value2 value3 value4 value5 value6 value7 - | ||
+ | " | ||
+ | Echo P8 compound parameter values: | ||
+ | VALUE8 | ||
+ | VALUE9 | ||
+ | VALUE10 IS MULTIWORD | ||
+ | VALUE11 | ||
+ | VALUE12 | ||
+ | |||
+ | ...processing continues | ||
+ | |||
+ | $ | ||
+ | </ | ||
command_file_parameters.txt · Last modified: 2019/11/12 16:02 by mmacgregor