CEEGTJS
retrieves and returns to the caller the symbol value and length of
the requested exported JCL symbol.
Syntax
>>-CEEGTJS--(--function_code--,--symbol_name--,--symbol_value--->
>--,--value_length--,--fc--)-----------------------------------><
- function_code (input)
- A fullword integer that contains the function code of the following
value:
- 1
- Retrieves the value and its associated length of an exported JCL
symbol.
- symbol_name (input)
- A halfword length-prefixed character string (VSTRING), representing
the name of an exported JCL symbol to be retrieved.
- symbol_value (output)
- A 255-byte fixed-length string. On return from this service, the
ssymbol_value contains the value of the
exported JCL symbol. If the length of the exported JCL symbol is shorter
than 255 characters, the returned string is padded with blanks.
- value_length (output)
- A fullword integer that contains the length of the value of the
specified JCL symbol.
- fc (output)
- A 12-byte feedback code, optional in some languages,
that indicates the result of this service. If you omit this parameter,
refer to Invoking callable services for the appropriate
syntax to indicate that the feedback code was omitted.
The following
symbolic conditions can result from this service:
Code |
Severity |
Message number |
Message text |
---|
CEE000 |
0 |
— |
The service 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 service failed
with return code return_code and reason
code reason_code. |
Usage notes
- Lowercase characters in the symbol_name
are converted to uppercase by CEEGTJS.
- For more information about JCL symbols, refer to the topic on
system symbols and JCL symbols in z/OS MVS JCL Reference.
Examples
- This example uses CEEGTJS to retrieve the value of an exported
JCL symbol.
/*Module/File Name: EDCGTJS */
/*********************************************************************/
/* */
/* THIS EXAMPLE CALLS CEEGTJS TO RETRIEVE THE VALUE OF AN EXPORTED */
/* JCL SYMBOL. */
/* */
/*********************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <leawi.h>
#include <ceeedcct.h>
int main(void) {
_FEEDBACK fc;
_INT4 funcode;
_CHAR255 symvalue;
_VSTRING symname;
_INT4 valuelen;
char *symbol="SYM1";
/* Setting the function code */
funcode=1;
/* Preparing the JCL symbol */
symname.length=strlen(symbol);
memcpy(symname.string, symbol,strlen(symbol));
/* Retrieving the value of the JCL symbol */
CEEGTJS(&funcode,&symname,symvalue,&valuelen,&fc);
if( _FBCHECK (fc, CEE000) !=0) {
printf("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);
}
Use
the following JCL to run EDCGTJS://JOB1 JOB FELE,MSGLEVEL=(2,0)
//STEP1 EXEC PGM=EDCGTJS
//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.