Hi Luca,
Here at 4GL Apps we built an open-source (MIT) framework that you can use to run jobs and flows from command line. You can pass parameters (as macro variables) and collect return codes. You can even run it on SAS 9 EBI and Base SAS, as well as Viya!
The docs are here:
https://cli.sasjs.io/flow
https://cli.sasjs.io/jobs
I extract the documentation for your perusal:
Syntax
sasjs job <action> <job path> [additional arguments]
Additional arguments may include:
--log (alias -l ) - path where the log of the finished job will be saved (if used, -w is implied).
--output (alias -o ) - path where output of the finished job execution will be saved.
--source (alieas -s ) - Provide the path to an input JSON containing job variables, structured as follows: {"macroVars":{"varname":"value","var2":"val2"}}
--target (alias -t ) - the target environment in which to deploy the services. If not specified, default target will be used, mentioned in sasjsconfig.json . The target can exist either in the local project configuration or in the global .sasjsrc file.
The following flags are only relevant for serverType VIYA:
--ignoreWarnings (alias -i ) - If present and return status only is provided, CLI will return status '0', when the job state is warning.
--returnStatusOnly (alias -r ) - If present and wait flag is provided, CLI will job status only (0 = success, 1 = warning, 2 = error).
--wait (alias -w ) - if present, CLI will wait for job completion.
... View more