Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Language Environment |
both | AMODE 64 |
#include <__le_api.h>
void __le_ceegtjs(_INT4 * function_code,
_VSTRING * symbol_name,
_CHAR255 * symbol_value,
_INT4 * value_length,
_FEEDBACK * fc);
The __le_ceegtjs() function retrieves and returns to the caller the symbol value and length of the requested exported JCL symbol.
Code | Severity | Message Number | Message Text |
CEE000 | 0 | - - | The function completed successfully. |
CEE3L9 | 0 | 3753 | The input symbol cannot be found in the current job step. |
CEE3LA | 3 | 3754 | Incorrect parameters detected. |
CEE3QS | 1 | 3932 | The system service failed with return code return_code and reason code reason_code. |
/* CELEBL31
This example retrieves the value of an exported JCL symbol.
*/
#include <stdio.h>
#include <string.h>
#include <__le_api.h>
int main()
{
_FEEDBACK fc;
_INT4 funcode;
_CHAR255 symvalue;
_VSTRING symname;
_INT4 valuelen;
char *symbol="SYM1";
/* Setting the function code */
funcode=1;
/* Preparing the JCL symbol name */
symname.length=strlen(symbol);
memcpy(symname.string, symbol,strlen(symbol));
/* Retrieving the value of the JCL symbol */
__le_ceegtjs(&funcode,&symname,symvalue,&valuelen,&fc);
if( fc.tok_sev > 0) {
printf("__le_ceegtjs failed with message number %d\n",
fc.tok_msgno);
exit(1);
}
symvalue[valuelen]='\0';
printf("The value of JCL symbol %s is %s. The length
of the value is %d\n",symbol,symvalue,valuelen);
}
//JOB1 JOB FELE,MSGLEVEL=(2,0)
//STEP1 EXEC PGM=CELEBL31
//E1 EXPORT SYMLIST=(SYM1,SYM2,SYM3)
//S1 SET SYM1=XXXX
//S2 SET SYM2=YYYY
//STEPLIB DD DSN=USER.LOADLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
Running this example would
produce the following output:The value of JCL symbol SYM1 is XXXX. The length of the value is 4.