I want to do some post-processing of the output of a REST job. The rest job returns several arrays stored in object variables. I want to return the values from these arrays in a data sequence so that I can wrap the REST jobs into EXEC VARA objects.
However, I don't want to have to write customized post-processing for each REST job. I want one JOBI I can include in the Post-Process tab of every similar job.
Is there a way to get a list of the variables and/or arrays set in the
Definition & Parsing tab of a REST job? Is there a way to automatically process these variables?
Failing that, is there a way to fill an array by indirect reference?
By this I mean something like:
:DEFINE &varValues1#,STRING,100
:FILL &varValues1#[] = GET_SCRIPT_VAR(&varName1#)
Unfortunately, the
:FILL
command does not currently work with the
GET_SCRIPT_VAR
function. If you try it, you’ll get the following error:
U00020264 Runtime error in object 'SYSTEM.GLOBAL.CREATE_DATA_SEQUENCE_FROM_REST_JOB_RESPONSE.JOBI', line '00009': Invalid function for FILL command.
It would be great if there were a function, e.g.,
PREP_PROCESS_RESPONSEVARS
, that provides a data sequence with the names and types of the variables generated in the Response / Definition & Parsing tab of REST job. This could be combined with a new
PREP_PROCESS_ARRAY
function that could be used to parse the response variables that are arrays.
This would make it relatively straightforward to write the general purpose REST output parsing JOBI that I have in mind.