-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90e03b9
commit 7176adc
Showing
1 changed file
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,45 @@ | ||
// Desc: Build out QSHPYRUN command line in RPG | ||
H DFTACTGRP(*NO) ACTGRP(*NEW) | ||
|
||
D ArgDS Ds Qualified | ||
D ArgCount 4b 0 | ||
D ArgVal 200a Dim(10) | ||
|
||
D CurArg S 5i 0 | ||
D ArgParm S 8000a INZ('') | ||
D Qt S 1a INZ('''') | ||
|
||
C *ENTRY PLIST | ||
C PARM ARGS 8002 | ||
C PARM CLCMD 9999 | ||
C PARM CLCMDLEN 15 5 | ||
C PARM Args 8002 | ||
C PARM CLCmd 9999 | ||
C PARM CLCmdLen 15 5 | ||
|
||
/free | ||
|
||
// Assemble CL command line | ||
// Move command list args to data structure | ||
ArgDS=Args; | ||
|
||
// Iterate and consolidate each | ||
// argument into single parm for CL list. | ||
CurArg=1; | ||
Dow CurArg <= ArgDS.ArgCount; | ||
ArgParm = %trim(ArgParm) + ' ' + qt + | ||
%trim(ArgDS.ArgVal(CurArg)) + qt; | ||
CurArg+=1; | ||
EndDo; | ||
|
||
// Assemble QSHPYRUN CL command line | ||
// Add question mark to prompt it | ||
CLCMD = '? QSHONI/QSHPYRUN ' + | ||
CLCmd = '? QSHONI/QSHPYRUN ' + | ||
'SCRIPTDIR(''/tmp/script.py'') ' + | ||
'SCRIPTFILE(myscript.py) ' + | ||
'ARGS(' + | ||
')'; | ||
'ARGS(' + %trim(ArgParm) + ')'; | ||
|
||
// Calculate full command length for QCMDEXEC | ||
clcmdlen=%len(%trim(CLCMD)); | ||
|
||
CLCmdLen=%len(%trim(CLCmd)); | ||
|
||
// Exit | ||
*inlr=*on; | ||
return; | ||
|
||
/end-free |