Definitely! We've done it several times-- one program, multiple commands. You can add additional
parameters, although all commands must have the same parameters in the same sequence. You can make
some parameters visible in one command, and hidden in others, by declaring them with a CONSTANT value.
Constant value (CONSTANT) - Help
Specifies that a value is passed to the command processing program as a
constant when the command being defined is processed; the parameter does
not appear externally on the command.
SEU==> WRKOUTQKE
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
*************** Beginning of data ***********************************************************
0001.00 CMD 890210
0002.00 PARM KWD(SECRET) TYPE(*CHAR) LEN(2) CONSTANT('KE') MIN(1) 890210
****************** End of data **************************************************************
SEU==> WRKOUTQLA
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
*************** Beginning of data ***********************************************************
0001.00 CMD 890210
0002.00 PARM KWD(SECRET) TYPE(*CHAR) LEN(2) CONSTANT('LA') MIN(1) 890210
****************** End of data **************************************************************
Both point to program UTLCDSPOQ
SEU==> UTLCDSPOQ
FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
*************** Beginning of data ***********************************************************
0001.00 PGM PARM(&LOCN) /* This is the 'SECRET' parameter from the CMD */920130
0002.00 DCL &LOCN *CHAR 2 890209
0003.00 DCL &MBR *CHAR 10 890209
0004.00 DCL &USER *CHAR 10 890922
0005.00 890209
0005.01 RTVJOBA USER(&USER) 920130
0005.02 920130
0005.03 CHGVAR VAR(&MBR) VALUE(&USER *TCAT 'OQ') 920130
0005.04 920130
0006.00 IF COND(&LOCN *NE 'UU') THEN(DO) 920130
0007.00 CHGVAR VAR(&MBR) VALUE('UTLPOUTQ' *CAT &LOCN) 920130
0008.00 OVRDBF FILE(UTLPSFL) TOFILE(UTLPSFL) MBR(&MBR) 920130
0009.00 CALL PGM(UTLRDSPOQ) /* displays customized list of outqs */ 920130
0010.00 MONMSG CPF0000 /* What could possibly go worng? */ 920130
0011.00 DLTOVR FILE(UTLPSFL) 920130
0012.00 ENDDO 920130
0014.00 ELSE DO /* (&LOCN *EQ 'UU') */ 920130
0016.00 OVRDBF FILE(UTLPSFL) TOFILE(UTLPSFL) MBR(&USER) 920130
0017.00 CALL PGM(UTLRDSPOQ) 920130
0018.00 MONMSG CPF0000 920130
0019.00 DLTOVR FILE(UTLPSFL) 920130
0020.00 ENDDO 920130
0020.03 920130
0021.01 QUIT: 920130
0022.00 ENDPGM 890922
****************** End of data ************************************************************
I stripped out a lot of 'extra' code in the program, but I think it'll still work!
Paul E Musselman
PaulMmn@xxxxxxxxxxxxx<mailto:PaulMmn@xxxxxxxxxxxxx>
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> On Behalf Of dlclark@xxxxxxxxxxxxxxxx
Sent: Friday, November 09, 2018 10:29 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: Preloaded Command Prompts
"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx<mailto:midrange-l-bounces@xxxxxxxxxxxx>> wrote on 11/09/2018
09:57:13 AM:
"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx<mailto:midrange-l-bounces@xxxxxxxxxxxx>> wrote on 11/09/2018
07:40:21 AM:
We do this by a CPY* command which then calls the ADD* command.
For example, our CPYJOBSCDE command retrieves a current job schedule
entry
and then optionally prompts you for the ADDJOBSCDE.
Copy Job Schedule Entry (CPYJOBSCDE)
Type choices, press Enter.
From job name . . . . . . . . . > ACD0010 Name
Entry number . . . . . . . . . . *FIRST 000001-999999,
*FIRST,
*LAST
To job name . . . . . . . . . . *FROMJOB Name, *FROMJOB
Prompt ADDJOBSCDE? . . . . . . . *NO *YES, *NO
Comments give you a clue where we got the basis from
/* Similar to CRTDUPSCDE from www.midrange.com<http://www.midrange.com>. */
OK, so you're saying that the only way to accomplish this is
with
separate commands specific to the action to be taken. If I must, then I
must. Thanks.
Related question... Since I have to create separate commands and
all of these commands will have the same basic parameters, is there a way
that I can use the same CPP for all of these commands? Meaning: other
than having a dummy parameter that shows on the command prompt screen, is
there a way for the CPP to know which command was used to invoke it --
such as a hidden parameter with the command action in it?
Sincerely,
Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300
Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331
As an Amazon Associate we earn from qualifying purchases.